Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update: add a workflow to update image #6

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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