Add .forgejo/workflows/docker-build.yml #2
2 changed files with 53 additions and 30 deletions
|
@ -36,38 +36,22 @@ jobs:
|
||||||
git tag "${{ steps.version.outputs.version }}" -m "[forgejo-action-tag]"
|
git tag "${{ steps.version.outputs.version }}" -m "[forgejo-action-tag]"
|
||||||
git push origin --tags
|
git push origin --tags
|
||||||
|
|
||||||
docker-build:
|
webserver:
|
||||||
runs-on: host
|
runs-on: host
|
||||||
needs:
|
needs: release
|
||||||
- release
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
repo:
|
|
||||||
- alpine-php8-webserver
|
|
||||||
- alpine-php8-cron-webserver
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Build Webserver
|
||||||
uses: actions/checkout@v4
|
uses: ./.github/workflows/docker-build.yml
|
||||||
with:
|
with:
|
||||||
github-server-url: https://git.h2-invent.com
|
repo_name: alpine-php8-webserver
|
||||||
repository: Public-System-Design/${{ matrix.repo }}
|
version: ${{ needs.release.outputs.version }}
|
||||||
ref: main
|
|
||||||
path: ${{ matrix.repo }}
|
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
cron:
|
||||||
uses: docker/login-action@v3
|
runs-on: host
|
||||||
|
needs: webserver
|
||||||
|
steps:
|
||||||
|
- name: Build Cron-Webserver
|
||||||
|
uses: ./.github/workflows/docker-build.yml
|
||||||
with:
|
with:
|
||||||
registry: git.h2-invent.com
|
repo_name: alpine-php8-cron-webserver
|
||||||
username: ${{ secrets.FORGEJO_ACTION_PACKAGE_RW_USER }}
|
version: ${{ needs.release.outputs.version }}
|
||||||
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 }}
|
|
||||||
|
|
39
.forgejo/workflows/docker-build.yml
Normal file
39
.forgejo/workflows/docker-build.yml
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
name: Build and Push Image
|
||||||
|
description: Builds and pushes a Docker image.
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
repo_name:
|
||||||
|
description: "Name of the repo (also used as build context path)"
|
||||||
|
required: true
|
||||||
|
version:
|
||||||
|
description: "Version tag"
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
github-server-url: https://git.h2-invent.com
|
||||||
|
repository: Public-System-Design/${{ inputs.repo_name }}
|
||||||
|
ref: main
|
||||||
|
path: ${{ inputs.repo_name }}
|
||||||
|
|
||||||
|
- 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 Docker image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: ./${{ inputs.repo_name }}
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
git.h2-invent.com/public-system-design/${{ inputs.repo_name }}:${{ inputs.version }}
|
||||||
|
git.h2-invent.com/public-system-design/${{ inputs.repo_name }}:latest
|
||||||
|
build-args: |
|
||||||
|
VERSION=${{ inputs.version }}
|
Loading…
Add table
Reference in a new issue