From d6526b831cbcccf51b7e51142defed03ee8118a0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 26 Mar 2023 20:34:33 +0300 Subject: use action for image meta (tmp disables push) --- .gitea/workflows/build.yml | 65 ++++++++++++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 23 deletions(-) (limited to '.gitea/workflows/build.yml') diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index f3e8790..999bb5e 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -26,11 +26,6 @@ jobs: - 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 - - name: setup qemu uses: https://github.com/docker/setup-qemu-action@v2 @@ -50,43 +45,67 @@ jobs: username: ${{ secrets.DOCKER_HUB_USER }} password: ${{ secrets.DOCKER_HUB_TOKEN }} + - name: get docker meta for web-nginx + id: meta_web_nginx + uses: https://github.com/docker/metadata-action@v4 + with: + images: | + ${{ secrets.REGISTRY_HOST }}/cthulhoo/the-epube-web-nginx + cthulhoo/the-epube-web-nginx + tags: | + type=sha,prefix={{ date 'YY.MM-' tz='UTC'}} + type=raw,value=latest,enable={{ is_default_branch }} + - name: build web-nginx image uses: https://github.com/docker/build-push-action@v4 with: - push: true + push: false 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 }} + tags: ${{ steps.meta_web_nginx.outputs.tags }} + labels: ${{ steps.meta_web_nginx.outputs.labels }} provenance: false + - name: get docker meta for dict + id: meta_dict + uses: https://github.com/docker/metadata-action@v4 + with: + images: | + ${{ secrets.REGISTRY_HOST }}/cthulhoo/the-epube-dict + cthulhoo/the-epube-dict + tags: | + type=sha,prefix={{ date 'YY.MM-' tz='UTC'}} + type=raw,value=latest,enable={{ is_default_branch }} + - name: build dict image uses: https://github.com/docker/build-push-action@v4 with: - push: true + push: false 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 }} + tags: ${{ steps.meta_dict.outputs.tags }} + labels: ${{ steps.meta_dict.outputs.labels }} provenance: false + - name: get docker meta for app + id: meta_app + uses: https://github.com/docker/metadata-action@v4 + with: + images: | + ${{ secrets.REGISTRY_HOST }}/cthulhoo/the-epube-fpm-static + cthulhoo/the-epube-fpm-static + tags: | + type=sha,prefix={{ date 'YY.MM-' tz='UTC'}} + type=raw,value=latest,enable={{ is_default_branch }} + - name: build app image uses: https://github.com/docker/build-push-action@v4 with: - push: true + push: false platforms: linux/amd64,linux/arm64,linux/arm/v7 context: .docker/app build-contexts: app-src=. - tags: | - ${{ 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 }} + tags: ${{ steps.meta_app.outputs.tags }} + labels: ${{ steps.meta_app.outputs.labels }} provenance: false -- cgit v1.2.3