Files
eleith 66d9f94216
ci/woodpecker/pr/build-dane-verify Pipeline was successful
ci/woodpecker/pr/build-porkbun-ddns Pipeline was successful
ci/woodpecker/push/build-dane-verify Pipeline was successful
ci/woodpecker/push/build-hledger Pipeline was successful
ci/woodpecker/push/build-nvim Pipeline was successful
ci/woodpecker/push/build-playwright Pipeline was successful
ci/woodpecker/push/build-porkbun-ddns Pipeline was successful
Align CI tags, PR checks, and docs
2026-10-24 08:56:01 -07:00

83 lines
2.4 KiB
YAML

name: Build and Push porkbun-ddns
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- "porkbun-ddns/**"
- ".github/workflows/build-porkbun-ddns.yml"
push:
branches:
- main
paths:
- "porkbun-ddns/**"
- ".github/workflows/build-porkbun-ddns.yml"
tags:
- "porkbun-ddns/v*"
jobs:
checks:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check and test script
run: |
shellcheck porkbun-ddns/update.sh porkbun-ddns/tests/update_test.sh
bash porkbun-ddns/tests/update_test.sh
build:
if: github.event_name != 'pull_request'
needs: checks
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Extract tag name
id: tag_name
run: |
if [[ "$GITHUB_REF_TYPE" == "tag" ]]; then
VERSION="${GITHUB_REF_NAME#porkbun-ddns/v}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
fi
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/containers-porkbun-ddns
flavor: latest=false
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=semver,pattern={{version}},value=${{ steps.tag_name.outputs.version }},enable=${{ github.ref_type == 'tag' }}
type=semver,pattern={{major}}.{{minor}},value=${{ steps.tag_name.outputs.version }},enable=${{ github.ref_type == 'tag' }}
type=semver,pattern={{major}},value=${{ steps.tag_name.outputs.version }},enable=${{ github.ref_type == 'tag' }}
- name: Login to GitHub Container Registry
if: github.ref == 'refs/heads/main' || github.ref_type == 'tag'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ./porkbun-ddns
file: ./porkbun-ddns/Dockerfile
push: ${{ github.ref == 'refs/heads/main' || github.ref_type == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}