fix #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Cache registry | |
uses: actions/cache@v2 | |
with: | |
key: v0-rust-registry-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }} | |
path: | | |
/tmp/.cargo/registry | |
/tmp/.cargo/git | |
- name: Cache target | |
uses: actions/cache@v2 | |
with: | |
key: v0-rust-target-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }} | |
restore-keys: | | |
v0-rust-target-${{ runner.os }}- | |
path: | | |
./target | |
- name: Pull muslrust | |
run: docker pull clux/muslrust | |
- name: Build pvgql | |
run: docker run | |
-v /tmp/.cargo/registry:/root/.cargo/registry | |
-v /tmp/.cargo/git:/root/.cargo/git | |
-v $GITHUB_WORKSPACE:/volume | |
--rm -t clux/muslrust | |
cargo build --target x86_64-unknown-linux-musl --release | |
- name: Build Docker image | |
run: | | |
docker build --no-cache -t pvgql . | |
docker save -o pvgql.tar pvgql | |
- name: Upload image to artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: pvgql.tar | |
path: pvgql.tar | |
- name: Fix cache | |
run: sudo chmod -R 777 /tmp/.cargo |