Skip to content

Commit

Permalink
aaa
Browse files Browse the repository at this point in the history
  • Loading branch information
taukakao committed Jan 30, 2024
1 parent f6e896a commit 0d57799
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/vib-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,10 @@ jobs:
jq -r '.image.releases[-1].digest' vanilla-image-info > digest.txt
echo Old digest is: $(cat last_digest.txt)
echo New digest is: $(cat digest.txt)
if [ $(cmp -s digest.txt last_digest.txt) ]; then
echo base image was updated since last build
echo "HAS_UPDATES=true" >> "$GITHUB_ENV"
echo "has_updates=true" >> "$GITHUB_OUTPUT"
else
echo no updates to the base image since last build
echo "has_updates=false" >> "$GITHUB_OUTPUT"
fi
echo "HAS_UPDATES=$(cmp -s digest.txt last_digest.txt)" >> "$GITHUB_ENV"
- name: Upload new digest
if: env.CHECK_UPDATES && env.HAS_UPDATES == 1
if: env.CHECK_UPDATES && env.HAS_UPDATES
uses: softprops/action-gh-release@v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"
Expand All @@ -61,23 +54,29 @@ jobs:
files: |
digest.txt
- name: Update was triggered manually
if: env.CHECK_UPDATES != true
- name: Set output
run: |
echo "has_updates=true" >> "$GITHUB_OUTPUT"
if [ ${{ env.HAS_UPDATES }} ]
then
echo base image was updated since last build
echo "has_updates=true" >> "$GITHUB_OUTPUT"
else
echo no updates to the base image since last build
echo "has_updates=false" >> "$GITHUB_OUTPUT"
fi
hello_world:
update:
runs-on: ubuntu-latest
needs: check_update
if: needs.check_update.outputs.exitcode == 0
if: needs.check_update.outputs.has_updates == true
steps:
- name: Hello World
run: echo "Hello, world"

bye_world:
dont_update:
runs-on: ubuntu-latest
needs: check_update
if: needs.check_update.outputs.exitcode != 0
if: needs.check_update.outputs.has_updates != true
steps:
- name: Bye World
run: echo "Bye, world"
Expand Down

0 comments on commit 0d57799

Please sign in to comment.