Skip to content

Commit

Permalink
Added workflow for COMMIT_HASH autopublish
Browse files Browse the repository at this point in the history
  • Loading branch information
1NepuNep1 committed Jan 17, 2025
1 parent 89b534b commit 85ec673
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
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

0 comments on commit 85ec673

Please sign in to comment.