Update build process to use forgejo
All checks were successful
Publish Docker image / Push Docker image to Forgejo Packages (push) Successful in 18m54s

This commit is contained in:
William Brawner 2024-11-05 22:22:38 -07:00
parent 0379540a72
commit d2fbc5f113
Signed by: wbrawner
GPG key ID: 8FF12381C6C90D35
2 changed files with 18 additions and 15 deletions

View file

@ -1,23 +1,22 @@
name: Publish Docker image
on:
push:
branches: main
tags:
- '*'
branches:
- main
jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
name: Push Docker image to Forgejo Packages
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/wbrawner/caddy-porkbun
git.wbrawner.com/wbrawner/caddy-porkbun
tags: |
type=schedule
type=ref,event=branch
@ -26,16 +25,20 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Set up Docker context
run: docker context create builders
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/setup-buildx-action@v3
with:
registry: ghcr.io
endpoint: builders
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: git.wbrawner.com
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
password: ${{ secrets.FORGEJO_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64

View file

@ -1,8 +1,8 @@
FROM caddy:2-builder-alpine AS builder
FROM docker.io/caddy:2-builder-alpine AS builder
RUN xcaddy build --with github.com/caddy-dns/porkbun@v0.2.1
FROM caddy:2-alpine
FROM docker.io/caddy:2-alpine
LABEL org.opencontainers.image.source=https://github.com/wbrawner/caddy-porkbun
COPY --from=builder /usr/bin/caddy /usr/bin/caddy