Release Stable Docker Image #45
This file contains hidden or 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: Release Stable Docker Image | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| packages: write | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| app_version: | |
| name: Get App Version | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.get_version.outputs.version }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get version from Cargo.toml | |
| id: get_version | |
| run: | | |
| version=$(grep '^version' Cargo.toml | head -n1 | sed -E 's/version = "(.*)"/\1/') | |
| echo "version=$version" >> $GITHUB_OUTPUT | |
| build_docker: | |
| name: Build Docker Multi-Platform and Export Linux Binary | |
| runs-on: ubuntu-latest | |
| needs: app_version | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push multi-platform Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./docker/Dockerfile.cross.gnu | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ghcr.io/${{ github.repository_owner }}/phlow:latest | |
| ghcr.io/${{ github.repository_owner }}/phlow:${{ needs.app_version.outputs.version }} |