From 0c42d99a934dd8442eab949ac1df874488e1b332 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 26 Mar 2023 17:25:11 +0300 Subject: [PATCH] shorten pipeline --- .gitea/workflows/build.yml | 66 +++++++++++--------------------------- 1 file changed, 18 insertions(+), 48 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 2dadbce22..ee8c9a9ed 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -55,66 +55,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: login to registry + uses: https://github.com/docker/login-action@v2 + with: + registry: ${{ secrets.REGISTRY_HOST }} + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: login to docker hub + uses: https://github.com/docker/login-action@v2 + with: + 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_PUSH_ENABLED }} - platforms: linux/amd64 - context: .docker/web-nginx - tags: | - registry-rw.fakecake.org/cthulhoo/ttrss-web-nginx:latest - registry-rw.fakecake.org/cthulhoo/ttrss-web-nginx:${{ env.BUILD_TAG }} - provenance: false - - - name: build app image - uses: https://github.com/docker/build-push-action@v4 - with: - push: ${{ !!secrets.REGISTRY_PUSH_ENABLED }} - platforms: linux/amd64 - context: .docker/app - build-contexts: - app-src=. - tags: | - registry-rw.fakecake.org/cthulhoo/ttrss-fpm-pgsql-static:latest - registry-rw.fakecake.org/cthulhoo/ttrss-fpm-pgsql-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 }} - - - 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/ttrss-web-nginx:latest + ${{ secrets.REGISTRY_HOST }}/cthulhoo/ttrss-web-nginx:${{ env.BUILD_TAG }} cthulhoo/ttrss-web-nginx:latest cthulhoo/ttrss-web-nginx:${{ env.BUILD_TAG }} provenance: false @@ -122,12 +90,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: | + ${{ secrets.REGISTRY_HOST }}/cthulhoo/ttrss-fpm-pgsql-static:latest + ${{ secrets.REGISTRY_HOST }}/cthulhoo/ttrss-fpm-pgsql-static:${{ env.BUILD_TAG }} cthulhoo/ttrss-fpm-pgsql-static:latest cthulhoo/ttrss-fpm-pgsql-static:${{ env.BUILD_TAG }} provenance: false