From 0f09cdf047d49da32bb1112233b1756880c9e6ef Mon Sep 17 00:00:00 2001 From: Mirko Brombin Date: Sun, 22 Sep 2024 22:27:20 +0200 Subject: [PATCH] ci: fix ci --- .github/workflows/vib-build.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vib-build.yml b/.github/workflows/vib-build.yml index 457b793..5ec7893 100644 --- a/.github/workflows/vib-build.yml +++ b/.github/workflows/vib-build.yml @@ -3,7 +3,7 @@ name: Vib Build on: push: branches: - - 'main' + - 'dev' tags: - '*' workflow_dispatch: @@ -18,6 +18,7 @@ jobs: steps: - name: Verify Base Image Integrity + if: ${{ github.ref_type == 'tag' }} run: gh attestation verify oci://ghcr.io/vanilla-os/desktop:main --owner Vanilla-OS env: @@ -25,7 +26,7 @@ jobs: build: runs-on: ubuntu-latest - needs: verify-image + needs: [verify-image] permissions: contents: write # Allow actions to create release packages: write # Allow pushing images to GHCR @@ -35,7 +36,12 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: vanilla-os/vib-gh-action@v0.7.4 + - name: Change tag in recipe + if: ${{ github.ref_type == 'tag' }} + run: | + sed 's/ghcr.io\/vanilla-os\/desktop:dev/ghcr.io\/vanilla-os\/desktop:main/' -i recipe.yml + + - uses: vanilla-os/vib-gh-action@v0.8.1 with: recipe: 'recipe.yml' plugins: 'Vanilla-OS/vib-fsguard:v1.5.3' @@ -51,6 +57,16 @@ jobs: echo "REPO_OWNER_LOWERCASE=$REPO_OWNER_LOWERCASE" >> "$GITHUB_ENV" echo "IMAGE_URL=ghcr.io/$REPO_OWNER_LOWERCASE/nvidia-exp" >> "$GITHUB_ENV" + - name: Extra image tag branch + if: ${{ github.ref_type != 'tag' }} + run: | + echo "EXTRA_TAG=ref,event=branch" >> "$GITHUB_ENV" + + - name: Extra image tag release + if: ${{ github.ref_type == 'tag' }} + run: | + echo "EXTRA_TAG=raw,main" >> "$GITHUB_ENV" + - name: Docker meta id: docker_meta uses: docker/metadata-action@v5 @@ -62,7 +78,7 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{raw}} type=semver,pattern=v{{major}} - type=ref,event=branch + type=${{ env.EXTRA_TAG }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3