mirror of
https://github.com/PrivSec-dev/privsec.dev
synced 2025-02-20 18:31:35 -05:00
Add workflow
It will update HUGO_VERSION variable in netlify.toml Signed-off-by: samsepi0l <contact@simpleprivacy.fr>
This commit is contained in:
parent
959fd033f8
commit
813cb65cd5
25
.github/workflows/hugo-version_workflow.yml
vendored
Normal file
25
.github/workflows/hugo-version_workflow.yml
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
name: Update Hugo Version
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *' # Run daily at midnight
|
||||||
|
workflow_dispatch: # Allow manual triggering
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-version:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Get latest Hugo version
|
||||||
|
id: hugo-version
|
||||||
|
run: echo "::set-output name=version::$(curl --silent https://api.github.com/repos/gohugoio/hugo/releases/latest | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')"
|
||||||
|
|
||||||
|
- name: Update netlify.toml
|
||||||
|
run: sed -i "s/HUGO_VERSION = \".*\"/HUGO_VERSION = \"${{ steps.hugo-version.outputs.version }}\"/" netlify.toml
|
||||||
|
|
||||||
|
- name: Commit changes
|
||||||
|
uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
|
with:
|
||||||
|
commit_message: 'Update Hugo version'
|
Loading…
Reference in New Issue
Block a user