name: Upload tagged release frontend image to GHCR permissions: contents: read packages: write on: release: types: [released] env: IMAGE_NAME: "voyage-frontend" jobs: upload: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Set lower case owner name id: repo_owner run: | LOWER_OWNER="${OWNER,,}" echo "REPO_OWNER=${LOWER_OWNER}" >>"$GITHUB_ENV" echo "repo_owner=${LOWER_OWNER}" >>"$GITHUB_OUTPUT" env: OWNER: "${{ github.repository_owner }}" - name: Build and push release Docker image with BuildKit cache uses: docker/build-push-action@v5 with: context: ./frontend platforms: linux/amd64,linux/arm64 push: true tags: | ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }} ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/${{ env.IMAGE_NAME }}:latest cache-from: | type=registry,ref=ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/${{ env.IMAGE_NAME }}:buildcache type=local,src=/tmp/.buildx-cache cache-to: | type=registry,ref=ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/${{ env.IMAGE_NAME }}:buildcache,mode=max type=local,dest=/tmp/.buildx-cache,mode=max env: DOCKER_BUILDKIT: 1