# GHCR へのコンテナイメージ publish # # - main push → ghcr.io/:latest(リモートサーバー通常運用が追従するタグ) # - develop push → ghcr.io/:develop(開発中バイパス用タグ) # - 各 push に :sha- タグも付与(ロールバック用) # # リモートサーバー側の利用方法は README「リモートサーバー / Docker deployment」と # deploy/docker/aac-update.sh を参照。 name: docker-image on: push: branches: - main - develop workflow_dispatch: permissions: contents: read packages: write jobs: build-push: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 - uses: oven-sh/setup-bun@v2 with: bun-version: "1.3.14" - name: Build frontend working-directory: web run: | bun install --frozen-lockfile bun run build - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - uses: docker/metadata-action@v5 id: meta with: images: ghcr.io/${{ github.repository }} tags: | type=raw,value=latest,enable={{is_default_branch}} type=ref,event=branch type=sha - uses: docker/build-push-action@v6 with: context: . file: deploy/docker/Dockerfile platforms: linux/amd64 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max