Files
docker-dynhost/.gitea/workflows/cron.yaml
T
Sagent 07de65c37e
PR Checks / hadolint (pull_request) Failing after 3s
PR Checks / build-test (pull_request) Failing after 2s
Standardize workflows to htpasswd pattern
Transform all 4 workflow files to match the standard pattern used by
perso/htpasswd (and offlineimap):

main.yaml:
  - Rename to 'Main Release'
  - hadolint (continue-on-error, dockerfile param) → test (build ci-image, run tests)
  → build (no push, just build target image) → tag (fetch-depth 0, git auth with
    SA_TOKEN_ACTION_PUSH_TAGS, semver tagging)

cron.yaml:
  - Keep original schedule '0 0 * * *'
  - hadolint → test → build-push (get-latest-tag, metadata with -latest
    only, no :latest tag)

tag.yaml:
  - hadolint → test → build-push (type=ref,event=tag + suffix=-latest)

pr.yaml:
  - hadolint (no continue-on-error, add dockerfile param) → build-test
  - Scope to pull_request branches: [master]
  - Use ci-image pattern with buildx setup
2026-06-13 21:25:36 +00:00

54 lines
1.8 KiB
YAML

name: Nightly Rebuild
on:
schedule:
- cron: '0 0 * * *'
jobs:
hadolint:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4111f1884172cec0e10 # v6
- uses: hadolint/hadolint-action@2332a7b74a6de0dda2e2221d575162eba76ba5e5 # v3.3.0
with:
dockerfile: Dockerfile
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4111f1884172cec0e10 # v6
- uses: docker/setup-buildx-action@d7f5e7f509e9e45cece5cec9e8c9e4f5afdd7de9 # v4
- run: docker build -t ci-image:${{ github.sha }} .
- run: bash tests/test.sh ci-image:${{ github.sha }}
build-push:
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4111f1884172cec0e10 # v6
with:
fetch-depth: 0
- uses: docker/setup-buildx-action@d7f5e7f509e9e45cece5cec9e8c9e4f5afdd7de9 # v4
- uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- id: get-latest-tag
run: |
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
echo "tag=$TAG" >> $GITHUB_OUTPUT
- id: meta
uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6
with:
images: jcabillot/docker-dynhost
tags: |
type=raw,value=${{ steps.get-latest-tag.outputs.tag }}-latest,enable=${{ steps.get-latest-tag.outputs.tag != '' }}
- uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
pull: true