Files
voyage/.github/workflows/frontend-release.yml

63 lines
1.9 KiB
YAML

name: Upload tagged release frontend image to GHCR
permissions:
contents: read
packages: write
on:
release:
types: [released]
env:
IMAGE_NAME: "voyage-frontend"
BUN_VERSION: "1.3.10"
jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
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
build-args: |
BUN_VERSION=${{ env.BUN_VERSION }}
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