From df2338b0bb74df80b1acaf6545d542acc6a10259 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 26 Mar 2023 17:15:45 +0300 Subject: shorten pipeline --- .gitea/workflows/build.yml | 79 ++++++++++++---------------------------------- 1 file changed, 20 insertions(+), 59 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 1a29a5b..df758f1 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -29,77 +29,34 @@ jobs: - 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: apk add --no-cache docker-cli - - name: setup qemu uses: https://github.com/docker/setup-qemu-action@v2 - 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 }} - platforms: linux/amd64 - 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 + - name: login to registry + uses: https://github.com/docker/login-action@v2 with: - push: ${{ !!secrets.REGISTRY_PUSH_ENABLED }} - platforms: linux/amd64 - 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 + registry: ${{ secrets.REGISTRY_HOST }} + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} - - name: build app image - uses: https://github.com/docker/build-push-action@v4 + - name: login to docker hub + uses: https://github.com/docker/login-action@v2 with: - push: ${{ !!secrets.REGISTRY_PUSH_ENABLED }} - platforms: linux/amd64 - 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: | - BASE64_AUTH=`echo -n "$REGISTRY_USER:$REGISTRY_PASSWORD" | base64` - mkdir -p ~/.docker - echo "{\"auths\": {\"$REGISTRY_HOST\": {\"auth\": \"$BASE64_AUTH\"}}}" > ~/.docker/config.json - env: - REGISTRY_USER: ${{ secrets.REGISTRY_GITHUB_USER }} - REGISTRY_PASSWORD: ${{ secrets.REGISTRY_GITHUB_ACCESS_TOKEN }} - REGISTRY_HOST: https://index.docker.io/v1/ - if: ${{ !!secrets.REGISTRY_GITHUB_PUSH_ENABLED }} + username: ${{ secrets.DOCKER_HUB_USER }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} - name: build web-nginx image uses: https://github.com/docker/build-push-action@v4 with: - push: ${{ !!secrets.REGISTRY_GITHUB_PUSH_ENABLED }} + push: true platforms: linux/amd64,linux/arm64,linux/arm/v7 context: .docker/web-nginx tags: | + ${{ secrets.REGISTRY_HOST }}/cthulhoo/the-epube-web-nginx:latest + ${{ secrets.REGISTRY_HOST }}/cthulhoo/the-epube-web-nginx:${{ env.BUILD_TAG }} cthulhoo/the-epube-web-nginx:latest cthulhoo/the-epube-web-nginx:${{ env.BUILD_TAG }} provenance: false @@ -107,10 +64,12 @@ jobs: - name: build dict image uses: https://github.com/docker/build-push-action@v4 with: - push: ${{ !!secrets.REGISTRY_GITHUB_PUSH_ENABLED }} + push: true platforms: linux/amd64,linux/arm64,linux/arm/v7 context: .docker/dict tags: | + ${{ secrets.REGISTRY_HOST }}/cthulhoo/the-epube-dict:latest + ${{ secrets.REGISTRY_HOST }}/cthulhoo/the-epube-dict:${{ env.BUILD_TAG }} cthulhoo/the-epube-dict:latest cthulhoo/the-epube-dict:${{ env.BUILD_TAG }} provenance: false @@ -118,12 +77,14 @@ jobs: - name: build app image uses: https://github.com/docker/build-push-action@v4 with: - push: ${{ !!secrets.REGISTRY_GITHUB_PUSH_ENABLED }} + push: true platforms: linux/amd64,linux/arm64,linux/arm/v7 context: .docker/app build-contexts: app-src=. tags: | - cthulhoo/the-epube-fpm-static:latest - cthulhoo/the-epube-fpm-static:${{ env.BUILD_TAG }} + ${{ secrets.REGISTRY_HOST }}/cthulhoo/the-epube-fpm-static:latest + ${{ secrets.REGISTRY_HOST }}/cthulhoo/the-epube-fpm-static:${{ env.BUILD_TAG }} + cthulhoo/the-epube-dict:latest + cthulhoo/the-epube-dict:${{ env.BUILD_TAG }} provenance: false -- cgit v1.2.3