Workflow file for this run
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: "Build for linux x86_64 and publish Docker image" | |
on: | |
release: | |
types: [created] | |
jobs: | |
release: | |
name: release linux x86_64 | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: hecrj/setup-rust-action@v1.4.0 | |
with: | |
rust-version: stable | |
- name: Compile | |
shell: bash | |
run: | | |
cargo clean | |
RUSTFLAGS='-C target-feature=+crt-static' cargo build --release --target x86_64-unknown-linux-gnu | |
- run: cp target/x86_64-unknown-linux-gnu/release/cassini . | |
- name: "Compress binaries" | |
if: true | |
uses: a7ul/tar-action@v1.1.2 | |
with: | |
command: c | |
files: | | |
cassini | |
LICENCE.md | |
README.md | |
outPath: "${{ runner.temp }}/cassini-x86_64-linux.tar.gz" | |
- name: "Release binaries" | |
if: true | |
uses: pragmatrix/release-action@v1.11.1-rs | |
with: | |
allowUpdates: true | |
replacesArtifacts: true | |
artifacts: "${{ runner.temp }}/cassini-x86_64-linux.tar.gz" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifactErrorsFailBuild: true | |
prerelease: true | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build Docker image with version tag | |
run: | | |
docker build -t ${{ secrets.DOCKER_USERNAME }}/cassini:${{ github.ref_name }} . | |
- name: Tag Docker image as latest | |
run: | | |
docker tag ${{ secrets.DOCKER_USERNAME }}/cassini:${{ github.ref_name }} ${{ secrets.DOCKER_USERNAME }}/cassini:latest | |
- name: Push Docker image with version tag | |
run: | | |
docker push ${{ secrets.DOCKER_USERNAME }}/cassini:${{ github.ref_name }} | |
- name: Push Docker image with latest tag | |
run: | | |
docker push ${{ secrets.DOCKER_USERNAME }}/cassini:latest |