ci: add docker publish workflows

This commit is contained in:
2026-05-10 10:13:04 +09:00
parent 7885824f92
commit c32214e714
3 changed files with 154 additions and 0 deletions

57
.github/workflows/publish-branch.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
name: publish-branch
on:
push:
branches:
- main
permissions:
contents: read
packages: write
concurrency:
group: publish-branch-${{ github.ref }}
cancel-in-progress: true
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/p-sw/codexdash
tags: |
type=raw,value=main
type=sha,prefix=sha-
- name: Build and push branch image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=publish-branch
cache-to: type=gha,mode=max,scope=publish-branch