-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added publish workflow. Added make build-image COMMIT_HASH feature
- Loading branch information
Showing
4 changed files
with
57 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: publish | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
commit-hash: | ||
description: "COMMIT_HASH" | ||
required: false | ||
type: string | ||
default: "default" | ||
|
||
jobs: | ||
build-and-optionally-publish: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build & test (always) | ||
run: | | ||
if [ "${{ github.event.inputs.commit-hash }}" = "default" ]; then | ||
make build-image | ||
else | ||
make build-image COMMIT_HASH=${{ github.event.inputs.commit-hash }} | ||
fi | ||
make all | ||
- name: Publish (optional) | ||
if: ${{ github.event.inputs.commit-hash != 'default' }} | ||
run: | | ||
echo "Publishing changes..." | ||
git config --global user.email "robot@umbrella"; | ||
git config --global user.name "robot"; | ||
git commit -am "Auto-update with COMMIT_HASH=${{ github.event.inputs.commit-hash }}" || echo "Nothing to commit" | ||
git push | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters