2023-11-15 05:00:48 +00:00
|
|
|
name: Publish Docker image
|
|
|
|
on:
|
|
|
|
push:
|
2024-11-06 05:22:38 +00:00
|
|
|
branches:
|
|
|
|
- main
|
2023-11-15 05:00:48 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
push_to_registry:
|
2024-11-06 05:22:38 +00:00
|
|
|
name: Push Docker image to Forgejo Packages
|
2023-11-15 05:00:48 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check out the repo
|
2024-11-06 05:22:38 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-11-15 05:00:48 +00:00
|
|
|
- name: Docker meta
|
|
|
|
id: meta
|
2024-11-06 05:22:38 +00:00
|
|
|
uses: docker/metadata-action@v5
|
2023-11-15 05:00:48 +00:00
|
|
|
with:
|
|
|
|
images: |
|
2024-11-06 05:22:38 +00:00
|
|
|
git.wbrawner.com/wbrawner/caddy-porkbun
|
2023-11-15 05:00:48 +00:00
|
|
|
tags: |
|
|
|
|
type=schedule
|
|
|
|
type=ref,event=branch
|
|
|
|
type=ref,event=pr
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
type=semver,pattern={{major}}
|
|
|
|
type=sha
|
2024-11-06 05:22:38 +00:00
|
|
|
- name: Set up Docker context
|
|
|
|
run: docker context create builders
|
2023-11-15 05:00:48 +00:00
|
|
|
- name: Set up Docker Buildx
|
2024-11-06 05:22:38 +00:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-11-15 05:00:48 +00:00
|
|
|
with:
|
2024-11-06 05:22:38 +00:00
|
|
|
endpoint: builders
|
|
|
|
- name: Login to Container Registry
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
registry: git.wbrawner.com
|
2023-11-15 05:00:48 +00:00
|
|
|
username: ${{ github.actor }}
|
2024-11-06 05:22:38 +00:00
|
|
|
password: ${{ secrets.FORGEJO_TOKEN }}
|
2023-11-15 05:00:48 +00:00
|
|
|
- name: Build and push
|
2024-11-06 05:22:38 +00:00
|
|
|
uses: docker/build-push-action@v6
|
2023-11-15 05:00:48 +00:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
push: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|