54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
name: Publish Docker image
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Version tag (e.g. 1.8.0)'
|
|
required: true
|
|
|
|
concurrency:
|
|
group: docker-publish
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set version
|
|
run: |
|
|
if [ -n "${{ github.event.inputs.version }}" ]; then
|
|
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
|
|
else
|
|
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
|
fi
|
|
|
|
- uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
|
|
|
- uses: docker/setup-qemu-action@v3
|
|
|
|
- uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: Dockerfile.ci
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: |
|
|
ghcr.io/jo-inc/camofox-browser:${{ env.VERSION }}
|
|
ghcr.io/jo-inc/camofox-browser:latest
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|