From 7450470b9c223540e85d29be8e3ec6529a8e73a6 Mon Sep 17 00:00:00 2001 From: Andrejs Cunskis Date: Sat, 13 Aug 2022 11:21:22 +0300 Subject: [PATCH 1/2] Push latest tag to github registry --- .github/workflows/release.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ccc4f37..fe94f276 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,19 +28,34 @@ jobs: uses: docker/setup-buildx-action@v2.0.0 - name: Login to DockerHub + if: startsWith(github.ref, 'refs/tags/') uses: docker/login-action@v2.0.0 with: username: ${{ github.actor }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v2.0.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Set images + id: images + run: | + if [[ "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then + echo "::set-output name=images::andrcuns/allure-report-publisher,ghcr.io/andrcuns/allure-report-publisher" + else + echo "::set-output name=images::ghcr.io/andrcuns/allure-report-publisher" + fi - name: Docker tags id: tags uses: docker/metadata-action@v4 with: - images: | - andrcuns/allure-report-publisher - flavor: | - latest=false + images: ${{ steps.images.outputs.images }} + flavor: latest=false tags: | type=raw,value=latest type=semver,pattern={{version}} From f747fff10047064971f878907e360e8b645aac33 Mon Sep 17 00:00:00 2001 From: Andrejs Cunskis Date: Sat, 13 Aug 2022 11:31:41 +0300 Subject: [PATCH 2/2] Cache layers from test job --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 80511ba5..8d5480cc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,6 +72,7 @@ jobs: load: true tags: publisher:latest cache-from: type=gha + cache-to: type=gha,mode=max - name: Download allure reports uses: actions/download-artifact@v3