summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2023-03-26 20:34:33 +0300
committerAndrew Dolgov <[email protected]>2023-03-26 20:34:33 +0300
commitd6526b831cbcccf51b7e51142defed03ee8118a0 (patch)
tree6df12a372d621259c3ac918856f1e904dc9906b8
parent5a8f4ac1159defd2b1f1ed944f6434a11f26c21b (diff)
use action for image meta (tmp disables push)
-rw-r--r--.gitea/workflows/build.yml65
1 files changed, 42 insertions, 23 deletions
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