From f8fb136834e306fca9540fb9ba7da80960906673 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 25 Mar 2023 23:54:09 +0300 Subject: multiarch testing --- .gitea/workflows/build.yml | 159 +++++++++++++++++++++++++-------------------- 1 file changed, 87 insertions(+), 72 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index b1784a9..5c2d851 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -6,6 +6,7 @@ on: push: branches: - "master" + - "multiarch-test" workflow_dispatch: {} defaults: @@ -18,61 +19,61 @@ jobs: steps: - uses: https://gitea.com/actions/checkout@v3 - - name: eslint - run: npx eslint js + # - name: eslint + # run: npx eslint js - - name: phpstan - run: php81 -d memory_limit=-1 ./vendor/bin/phpstan --memory-limit=2G + # - name: phpstan + # run: php81 -d memory_limit=-1 ./vendor/bin/phpstan --memory-limit=2G - - run: echo REPO_TIMESTAMP=$(git --git-dir '.git' --no-pager log --pretty='%ct' -n1 HEAD) >> $GITHUB_ENV - - run: echo REPO_COMMIT=$(git --git-dir '.git' --no-pager log --pretty='%h' -n1 HEAD) >> $GITHUB_ENV - - run: echo REPO_COMMIT_FULL=$(git --git-dir '.git' --no-pager log --pretty='%H' -n1 HEAD) >> $GITHUB_ENV - - run: echo BUILD_TAG=$(date -d @${REPO_TIMESTAMP} +%y.%m)-${REPO_COMMIT} >> $GITHUB_ENV + # - run: echo REPO_TIMESTAMP=$(git --git-dir '.git' --no-pager log --pretty='%ct' -n1 HEAD) >> $GITHUB_ENV + # - run: echo REPO_COMMIT=$(git --git-dir '.git' --no-pager log --pretty='%h' -n1 HEAD) >> $GITHUB_ENV + # - run: echo REPO_COMMIT_FULL=$(git --git-dir '.git' --no-pager log --pretty='%H' -n1 HEAD) >> $GITHUB_ENV + # - run: echo BUILD_TAG=$(date -d @${REPO_TIMESTAMP} +%y.%m)-${REPO_COMMIT} >> $GITHUB_ENV - name: setup buildx uses: https://github.com/docker/setup-buildx-action@v2 - - name: login into registry - run: | - BASE64_AUTH=`echo -n "$REGISTRY_USER:$REGISTRY_PASSWORD" | base64` - mkdir -p ~/.docker - echo "{\"auths\": {\"registry-rw.fakecake.org\": {\"auth\": \"$BASE64_AUTH\"}}}" > ~/.docker/config.json - env: - REGISTRY_USER: ${{ secrets.REGISTRY_USER }} - REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} - if: ${{ !!secrets.REGISTRY_PUSH_ENABLED }} - - - name: build web-nginx image - uses: https://github.com/docker/build-push-action@v4 - with: - push: ${{ !!secrets.REGISTRY_PUSH_ENABLED }} - context: .docker/web-nginx - tags: | - registry-rw.fakecake.org/cthulhoo/the-epube-web-nginx:latest - registry-rw.fakecake.org/cthulhoo/the-epube-web-nginx:${{ env.BUILD_TAG }} - provenance: false - - - name: build dict image - uses: https://github.com/docker/build-push-action@v4 - with: - push: ${{ !!secrets.REGISTRY_PUSH_ENABLED }} - context: .docker/dict - tags: | - registry-rw.fakecake.org/cthulhoo/the-epube-dict:latest - registry-rw.fakecake.org/cthulhoo/the-epube-dict:${{ env.BUILD_TAG }} - provenance: false - - - name: build app image - uses: https://github.com/docker/build-push-action@v4 - with: - push: ${{ !!secrets.REGISTRY_PUSH_ENABLED }} - context: .docker/app - build-contexts: - app-src=. - tags: | - registry-rw.fakecake.org/cthulhoo/the-epube-fpm-static:latest - registry-rw.fakecake.org/cthulhoo/the-epube-fpm-static:${{ env.BUILD_TAG }} - provenance: false + # - name: login into registry + # run: | + # BASE64_AUTH=`echo -n "$REGISTRY_USER:$REGISTRY_PASSWORD" | base64` + # mkdir -p ~/.docker + # echo "{\"auths\": {\"registry-rw.fakecake.org\": {\"auth\": \"$BASE64_AUTH\"}}}" > ~/.docker/config.json + # env: + # REGISTRY_USER: ${{ secrets.REGISTRY_USER }} + # REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} + # if: ${{ !!secrets.REGISTRY_PUSH_ENABLED }} + + # - name: build web-nginx image + # uses: https://github.com/docker/build-push-action@v4 + # with: + # push: ${{ !!secrets.REGISTRY_PUSH_ENABLED }} + # context: .docker/web-nginx + # tags: | + # registry-rw.fakecake.org/cthulhoo/the-epube-web-nginx:latest + # registry-rw.fakecake.org/cthulhoo/the-epube-web-nginx:${{ env.BUILD_TAG }} + # provenance: false + + # - name: build dict image + # uses: https://github.com/docker/build-push-action@v4 + # with: + # push: ${{ !!secrets.REGISTRY_PUSH_ENABLED }} + # context: .docker/dict + # tags: | + # registry-rw.fakecake.org/cthulhoo/the-epube-dict:latest + # registry-rw.fakecake.org/cthulhoo/the-epube-dict:${{ env.BUILD_TAG }} + # provenance: false + + # - name: build app image + # uses: https://github.com/docker/build-push-action@v4 + # with: + # push: ${{ !!secrets.REGISTRY_PUSH_ENABLED }} + # context: .docker/app + # build-contexts: + # app-src=. + # tags: | + # registry-rw.fakecake.org/cthulhoo/the-epube-fpm-static:latest + # registry-rw.fakecake.org/cthulhoo/the-epube-fpm-static:${{ env.BUILD_TAG }} + # provenance: false - name: login into docker hub run: | @@ -85,34 +86,48 @@ jobs: REGISTRY_HOST: https://index.docker.io/v1/ if: ${{ !!secrets.REGISTRY_GITHUB_PUSH_ENABLED }} - - name: build web-nginx image - uses: https://github.com/docker/build-push-action@v4 + - name: docker meta nginx + id: meta_nginx + uses: https://github.com/docker/docker/metadata-action@v4 with: - push: ${{ !!secrets.REGISTRY_GITHUB_PUSH_ENABLED }} - context: .docker/web-nginx + # list of Docker images to use as base name for tags + images: | + registry-rw.fakecake.org/cthulhoo/the-epube-web-nginx tags: | - cthulhoo/the-epube-web-nginx:latest - cthulhoo/the-epube-web-nginx:${{ env.BUILD_TAG }} - provenance: false + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha - - name: build dict image + - name: build web-nginx image uses: https://github.com/docker/build-push-action@v4 with: push: ${{ !!secrets.REGISTRY_GITHUB_PUSH_ENABLED }} - context: .docker/dict - tags: | - cthulhoo/the-epube-dict:latest - cthulhoo/the-epube-dict:${{ env.BUILD_TAG }} + context: .docker/web-nginx + tags: ${{ steps.meta_nginx.outputs.tags }} provenance: false - - name: build app image - uses: https://github.com/docker/build-push-action@v4 - with: - push: ${{ !!secrets.REGISTRY_GITHUB_PUSH_ENABLED }} - context: .docker/app - build-contexts: - app-src=. - tags: | - cthulhoo/the-epube-fpm-static:latest - cthulhoo/the-epube-fpm-static:${{ env.BUILD_TAG }} - provenance: false + # - name: build dict image + # uses: https://github.com/docker/build-push-action@v4 + # with: + # push: ${{ !!secrets.REGISTRY_GITHUB_PUSH_ENABLED }} + # context: .docker/dict + # tags: | + # cthulhoo/the-epube-dict:latest + # cthulhoo/the-epube-dict:${{ env.BUILD_TAG }} + # provenance: false + + # - name: build app image + # uses: https://github.com/docker/build-push-action@v4 + # with: + # push: ${{ !!secrets.REGISTRY_GITHUB_PUSH_ENABLED }} + # context: .docker/app + # build-contexts: + # app-src=. + # tags: | + # cthulhoo/the-epube-fpm-static:latest + # cthulhoo/the-epube-fpm-static:${{ env.BUILD_TAG }} + # provenance: false -- cgit v1.2.3