diff --git a/.github/workflows/vib-build.yml b/.github/workflows/vib-build.yml index 556b8f8..693fedb 100644 --- a/.github/workflows/vib-build.yml +++ b/.github/workflows/vib-build.yml @@ -8,8 +8,8 @@ on: workflow_dispatch: env: - REGISTRY_USER: ${{ github.actor }} - REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + GITHUB_USER: ${{ github.actor }} + DIGEST_RELEASE_TAG: save-digest jobs: check_update: @@ -20,12 +20,15 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Install dependencies + run: sudo apt-get install jq + - name: Check if there was an update to the base image if: github.event_name != 'schedule' run: | - sudo apt-get install jq bash ${GITHUB_WORKSPACE}/.github/workflows/check_image_update.sh echo "exitcode=$?" >> "$GITHUB_OUTPUT" + curl https://github.com/${{ github.repository }}/releases/download/${{ env.DIGEST_RELEASE_TAG }}/digest.txt curl https://differ.vanillaos.org/images/desktop > vanilla-image-info echo "digest=$(jq -r '.image.releases[-1].digest' vanilla-image-info)" > digest.txt @@ -34,10 +37,11 @@ jobs: run: | echo "exitcode=0" >> "$GITHUB_OUTPUT" - - uses: softprops/action-gh-release@v1 + - name: Upload new digest + uses: softprops/action-gh-release@v1 with: token: "${{ secrets.GITHUB_TOKEN }}" - tag_name: "save-digest" + tag_name: "${{ env.DIGEST_RELEASE_TAG }}" prerelease: true name: "This keeps track of the current digest" files: | @@ -79,5 +83,5 @@ jobs: # - name: Push To GHCR # if: github.repository == 'vanilla-os/desktop-image' # run: | -# docker login ghcr.io -u ${{ env.REGISTRY_USER }} -p ${{ env.REGISTRY_PASSWORD }} +# docker login ghcr.io -u ${{ env.GITHUB_USER }} -p ${{ secrets.GITHUB_TOKEN }} # docker image push "ghcr.io/vanilla-os/desktop:main"