publish #5
Workflow file for this run
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
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 | |
git status | |
- 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 | |