Skip to content

Commit

Permalink
Merge pull request #6 from hostwithquantum/update-cli
Browse files Browse the repository at this point in the history
Update: add a workflow to update image
  • Loading branch information
till authored Nov 24, 2023
2 parents 92fc15b + 53dfe34 commit f8ce294
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/update-hugo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: update-hugo

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'

permissions:
contents: "write"
pull-requests: "write"

jobs:
updatecli:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: updatecli/updatecli-action@v2
- run: "updatecli diff --config ./updatecli/updatecli.d --values updatecli/values.yaml"
env:
UPDATECLI_GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- run: "updatecli apply --config ./updatecli/updatecli.d --values updatecli/values.yaml"
env:
UPDATECLI_GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
48 changes: 48 additions & 0 deletions updatecli/updatecli.d/hugo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Update Hugo from upstream

scms:
default:
kind: github
spec:
user: "{{ .github.user }}"
email: "{{ .github.email }}"
owner: "{{ .github.owner }}"
repository: "{{ .github.repository }}"
token: "{{ requiredEnv .github.token }}"
branch: "{{ .github.branch }}"

sources:
gohugo:
name: Get latest Hugo release
kind: githubrelease
spec:
owner: "gohugoio"
repository: "hugo"
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
versionfilter:
kind: latest
transformers:
- trimprefix: 'v'

targets:
dockerfile:
name: Update Dockerfile ARG HUGO_VERSION
kind: dockerfile
scmid: default
sourceid: gohugo
spec:
file: Dockerfile
instruction:
keyword: ARG
matcher: HUGO_VERSION

actions:
default:
kind: github/pullrequest
scmid: default
title: 'Update Hugo version to {{ source "gohugo" }}'
spec:
automerge: false
labels:
- dependencies
- enhancement
7 changes: 7 additions & 0 deletions updatecli/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
github:
user: "GitHub Actions Bot"
owner: "hostwithquantum"
repository: hugo-docker
token: "UPDATECLI_GITHUB_TOKEN"
branch: main
hidecredit: true

0 comments on commit f8ce294

Please sign in to comment.