From fbceb71ab49da7bed046db3cbc4d5591b5000519 Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Sun, 22 Jun 2025 14:31:47 +0200 Subject: [PATCH 1/2] Add .forgejo/workflows/docker-build.yml --- .forgejo/workflows/docker-build.yml | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .forgejo/workflows/docker-build.yml diff --git a/.forgejo/workflows/docker-build.yml b/.forgejo/workflows/docker-build.yml new file mode 100644 index 0000000..5b3b5b0 --- /dev/null +++ b/.forgejo/workflows/docker-build.yml @@ -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 }} \ No newline at end of file -- 2.39.5 From 30c682209af929b0964e598e0a0b04985a96fc4f Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Sun, 22 Jun 2025 14:33:49 +0200 Subject: [PATCH 2/2] Update .forgejo/workflows/build.yml --- .forgejo/workflows/build.yml | 44 ++++++++++++------------------------ 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index dc24ef6..b051901 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -36,38 +36,22 @@ jobs: git tag "${{ steps.version.outputs.version }}" -m "[forgejo-action-tag]" git push origin --tags - docker-build: + webserver: runs-on: host - needs: - - release - strategy: - matrix: - repo: - - alpine-php8-webserver - - alpine-php8-cron-webserver + needs: release steps: - - name: Checkout Repository - uses: actions/checkout@v4 + - name: Build Webserver + uses: ./.github/workflows/docker-build.yml with: - github-server-url: https://git.h2-invent.com - repository: Public-System-Design/${{ matrix.repo }} - ref: main - path: ${{ matrix.repo }} + repo_name: alpine-php8-webserver + version: ${{ needs.release.outputs.version }} - - name: Login to Docker Hub - uses: docker/login-action@v3 + cron: + runs-on: host + needs: webserver + steps: + - name: Build Cron-Webserver + uses: ./.github/workflows/docker-build.yml 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 }} + repo_name: alpine-php8-cron-webserver + version: ${{ needs.release.outputs.version }} -- 2.39.5