Skip to content

Commit

Permalink
build everything in one workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pschichtel authored and CubeEngine Sponge Updater committed Oct 4, 2023
1 parent 08075fa commit 2950cce
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 29 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Build Image
# This is a basic workflow to help you get started with Actions

name: Fetch Sponge Versions

# Controls when the action will run.
on:
push:
branches:
Expand All @@ -9,11 +12,16 @@ on:
- recommended-versions.json
- Dockerfile
- build-images.sh
- fetch-versions.sh
- .github/workflows/*
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Login to GitHub Container Registry
Expand All @@ -24,3 +32,4 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
run: ./build-images.sh

25 changes: 0 additions & 25 deletions .github/workflows/fetch-versions.yml

This file was deleted.

9 changes: 7 additions & 2 deletions build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,10 @@ build_images() {
done
}

build_images latest
build_images recommended
if ./fetch-versions.sh
then
build_images latest
build_images recommended
else
echo "Nothing changed, nothing to build!"
fi
4 changes: 3 additions & 1 deletion fetch-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ git config user.email '[email protected]'

git add "$latest_versions_file" "$recommended_versions_file"

if git commit -m 'My hands are typing words....'
if git commit -m 'My hands are still typing words....'
then
git push
exit 0
else
echo "No new versions!"
exit 1
fi

0 comments on commit 2950cce

Please sign in to comment.