diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index bdf40dc..46489fd 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -5,52 +5,97 @@ on: push: branches: - main - + schedule: - cron: "0 1 * * *" + workflow_dispatch: + concurrency: group: docker-build-prod cancel-in-progress: true jobs: - publish: + + # ─── APACHE ─────────────────────────────────────────────────────────────── + + build-apache-amd64: + runs-on: ubuntu-latest + permissions: + packages: write + container: + image: catthehacker/ubuntu:act-latest + outputs: + digest: ${{ steps.build.outputs.digest }} + steps: + - uses: actions/checkout@v3 + - uses: docker/setup-buildx-action@v1 + - uses: docker/login-action@v3 + with: + registry: git.steelants.cz + username: ${{ secrets.GITEAUSER }} + password: ${{ secrets.GITEAPASSWD }} + - id: build + uses: docker/build-push-action@v6 + with: + context: apache + platforms: linux/amd64 + outputs: type=image,name=git.steelants.cz/steelants/docker_php_base,push-by-digest=true,name-canonical=true,push=true + + build-apache-arm64: + runs-on: ubuntu-latest-arm + permissions: + packages: write + container: + image: catthehacker/ubuntu:act-latest + outputs: + digest: ${{ steps.build.outputs.digest }} + steps: + - uses: actions/checkout@v3 + - uses: docker/setup-buildx-action@v1 + - uses: docker/login-action@v3 + with: + registry: git.steelants.cz + username: ${{ secrets.GITEAUSER }} + password: ${{ secrets.GITEAPASSWD }} + - id: build + uses: docker/build-push-action@v6 + with: + context: apache + platforms: linux/arm64 + outputs: type=image,name=git.steelants.cz/steelants/docker_php_base,push-by-digest=true,name-canonical=true,push=true + + manifest-apache: + needs: [build-apache-amd64, build-apache-arm64] runs-on: ubuntu-latest permissions: packages: write container: image: catthehacker/ubuntu:act-latest steps: - - uses: actions/checkout@v3 - - uses: docker/setup-buildx-action@v1 - - uses: docker/login-action@v3 with: registry: git.steelants.cz username: ${{ secrets.GITEAUSER }} password: ${{ secrets.GITEAPASSWD }} + - name: Create and push multi-arch manifest + run: | + docker buildx imagetools create -t git.steelants.cz/steelants/docker_php_base:latest \ + git.steelants.cz/steelants/docker_php_base@${{ needs.build-apache-amd64.outputs.digest }} \ + git.steelants.cz/steelants/docker_php_base@${{ needs.build-apache-arm64.outputs.digest }} - - uses: docker/build-push-action@v6 - with: - context: apache - push: true - tags: git.steelants.cz/steelants/docker_php_base:latest - - # ✅ Notifikace při úspěšném deploymentu - name: Discord Webhook Success if: success() uses: tsickert/discord-webhook@v6.0.0 with: webhook-url: ${{ secrets.WEBHOOK_URL }} content: | - ✅ APACHE - Build successful! + ✅ APACHE - Build successful! (amd64 + arm64) Repo: ${{ github.repository }} Branch: ${{ github.ref_name }} Commit: ${{ github.sha }} - Version: ${{ env.release_version }} - # ❌ Notifikace při neúspěšném deploymentu - name: Discord Webhook Failure if: failure() uses: tsickert/discord-webhook@v6.0.0 @@ -61,36 +106,3 @@ jobs: Repo: ${{ github.repository }} Branch: ${{ github.ref_name }} Commit: ${{ github.sha }} - Version: ${{ env.release_version }} - - - uses: docker/build-push-action@v6 - with: - context: fmp-alpine - push: true - tags: git.steelants.cz/steelants/docker_php_base:fpm-alpine-latest - - # ✅ Notifikace při úspěšném deploymentu - - name: Discord Webhook Success - if: success() - uses: tsickert/discord-webhook@v6.0.0 - with: - webhook-url: ${{ secrets.WEBHOOK_URL }} - content: | - ✅ FMP - ALPINE - Build successful! - Repo: ${{ github.repository }} - Branch: ${{ github.ref_name }} - Commit: ${{ github.sha }} - Version: ${{ env.release_version }} - - # ❌ Notifikace při neúspěšném deploymentu - - name: Discord Webhook Failure - if: failure() - uses: tsickert/discord-webhook@v6.0.0 - with: - webhook-url: ${{ secrets.WEBHOOK_URL }} - content: | - ❌ FMP - ALPINE - Build failed! - Repo: ${{ github.repository }} - Branch: ${{ github.ref_name }} - Commit: ${{ github.sha }} - Version: ${{ env.release_version }} \ No newline at end of file