-
Notifications
You must be signed in to change notification settings - Fork 13
60 lines (52 loc) · 1.65 KB
/
update-rocky.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#######################################################
# Check dockerhub for updates to the rocky container #
#######################################################
#
################################################
# NECESSARY GITHUB SECRETS TO SET #
################################################
# secrets.imagename : e.g "<org>/<image>"
# secrets.registryuser
# secrets.registrypwd
# secrets.server : (not currently implemented)
################################################
name: Check For Upstream Updates
on:
schedule:
# Once a day at 00:00 UTC
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
checkUpstream:
runs-on: ubuntu-latest
steps:
- name: Set environment variables
run: |
echo "scriptsdir=.github/helperScripts" >> $GITHUB_ENV
- name: Checkout default branch
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Verify repo has been cloned
run: |
git status
git branch -a
- name: Grab the most recent upstream version
run: |
upstream=$(${{ env.scriptsdir }}/dockertags.sh \
--user ${{ secrets.registryuser }} \
--password ${{ secrets.registrypwd }} \
--namespace library \
--image rockylinux \
| grep -v -e "latest" -e "minimal" \
| sort -Vr \
| head -n1)
echo $upstream
echo "upstream=$upstream" >> $GITHUB_ENV
- name: Check, update, build, push
run: |
./${{ env.scriptsdir }}/updateBuildPush.sh \
-u ${{ env.upstream }} \
-i ${{ secrets.imagename }} \
-t ${{ secrets.registrypwd }} \
-s ${{ secrets.registryuser }}