Skip to content

Commit 07a0214

Browse files
authored
Merge pull request #2 from olblak/updatecli
Add Updatecli workflow
2 parents 307f524 + d52c012 commit 07a0214

3 files changed

Lines changed: 71 additions & 1 deletion

File tree

.github/workflows/updatecli.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: updatecli
3+
4+
on:
5+
workflow_dispatch:
6+
schedule:
7+
# * is a special character in YAML so you have to quote this string
8+
# Run once a day
9+
- cron: '*/10 * * * *'
10+
11+
jobs:
12+
updatecli:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Diff
19+
uses: updatecli/updatecli-action@v1
20+
with:
21+
command: diff
22+
env:
23+
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Apply
26+
uses: updatecli/updatecli-action@v1
27+
env:
28+
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ghcr.io/updatecli/updatecli:v0.3.2
1+
ARG UPDATECLI_VERSION=v0.3.2
2+
FROM ghcr.io/updatecli/updatecli:$UPDATECLI_VERSION
23

34
COPY github-actions-entrypoint.bash /usr/local/bin/github-actions-entrypoint.bash
45

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: Bump updatecli version
3+
sources:
4+
default:
5+
name: Get latest updatecli version
6+
kind: githubRelease
7+
spec:
8+
owner: updatecli
9+
repository: updatecli
10+
token: {{requiredEnv "UPDATECLI_GITHUB_TOKEN"}}
11+
conditions:
12+
dockerImage:
13+
name: Ensure that the image docker image tag is published
14+
kind: dockerImage
15+
spec:
16+
image: "ghcr.io/updatecli/updatecli"
17+
dockerfile:
18+
name: "Test if ARG UPDATECLI_VERSION is set"
19+
kind: dockerfile
20+
spec:
21+
file: Dockerfile
22+
instruction:
23+
keyword: "ARG"
24+
matcher: "UPDATECLI_VERSION"
25+
targets:
26+
dockerfile:
27+
name: "Update the value of ARG UPDATECLI_VERSION in the Dockerfile"
28+
kind: dockerfile
29+
spec:
30+
file: Dockerfile
31+
instruction:
32+
keyword: "ARG"
33+
matcher: "UPDATECLI_VERSION"
34+
scm:
35+
github:
36+
user: updatecli
37+
email: me@olblak.com
38+
owner: updatecli
39+
repository: updatecli-action
40+
token: {{requiredEnv "UPDATECLI_GITHUB_TOKEN"}}
41+
branch: main

0 commit comments

Comments
 (0)