V1.9.0 🇩🇪 #74
Workflow file for this run
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: Build and Push Docker Images | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| release: | |
| types: [released] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| packages: write | |
| jobs: | |
| build_and_push: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| image: [backend, frontend] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up QEMU | |
| uses: docker/[email protected] | |
| - name: Set up Docker Buildx | |
| uses: docker/[email protected] | |
| - name: Login to GitHub Container Registry | |
| uses: docker/[email protected] | |
| if: ${{ !github.event.pull_request.head.repo.fork }} | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Ensure we have a lowercase owner/repo for all refs | |
| - name: Lowercase repository | |
| id: repo | |
| shell: bash | |
| run: echo "name=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" | |
| - name: Generate docker image tags | |
| id: metadata | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| name=ghcr.io/${{ steps.repo.outputs.name }}-${{ matrix.image }},enable=true | |
| - name: Copy VERSION into frontend build context | |
| if: ${{ matrix.image == 'frontend' }} | |
| run: cp VERSION frontend/VERSION | |
| - name: Build and push image | |
| uses: docker/[email protected] | |
| with: | |
| context: ${{ matrix.image }} | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ !github.event.pull_request.head.repo.fork }} | |
| cache-from: | | |
| type=registry,ref=ghcr.io/${{ steps.repo.outputs.name }}-${{ matrix.image }}:buildcache | |
| type=gha | |
| cache-to: | | |
| type=registry,ref=ghcr.io/${{ steps.repo.outputs.name }}-${{ matrix.image }}:buildcache,mode=max | |
| type=gha,mode=max | |
| tags: ${{ steps.metadata.outputs.tags }} | |
| labels: ${{ steps.metadata.outputs.labels }} |