alpine-php8-webserver/.forgejo/workflows/build.yml
holzi1005 a70d9e73dc
Some checks failed
docker-build / release (push) Successful in 5s
docker-build / docker-build (alpine-php8-webserver) (push) Has been cancelled
docker-build / docker-build (alpine-php8-cron-webserver) (push) Has been cancelled
Update .forgejo/workflows/build.yml
2025-06-22 14:27:13 +02:00

73 lines
2 KiB
YAML

name: docker-build
on:
push:
branches:
- main
permissions: write-all
jobs:
release:
runs-on: docker
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Define next tag
uses: https://github.com/paulhatch/semantic-version@v5.0.2
id: version
with:
tag_prefix: ""
major_pattern: "(MAJOR)"
minor_pattern: "(MINOR)"
change_path: .
version_format: "${major}.${minor}.${patch}"
- name: Create tag
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git tag "${{ steps.version.outputs.version }}" -m "[forgejo-action-tag]"
git push origin --tags
docker-build:
runs-on: host
needs:
- release
strategy:
matrix:
repo:
- alpine-php8-webserver
- alpine-php8-cron-webserver
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
github-server-url: https://git.h2-invent.com
repository: Public-System-Design/${{ matrix.repo }}
ref: main
path: ${{ matrix.repo }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: git.h2-invent.com
username: ${{ secrets.FORGEJO_ACTION_PACKAGE_RW_USER }}
password: ${{ secrets.FORGEJO_ACTION_PACKAGE_RW_KEY }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./${{ matrix.repo }}
push: true
tags: |
git.h2-invent.com/public-system-design/${{ matrix.repo }}:${{ needs.release.outputs.version }}
git.h2-invent.com/public-system-design/${{ matrix.repo }}:latest
build-args: |
VERSION=${{ needs.release.outputs.version }}