-
Notifications
You must be signed in to change notification settings - Fork 3
61 lines (56 loc) · 1.75 KB
/
trigger-build.yaml
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
61
name: Trigger builds
on:
schedule:
# Every monday at 10:00 UTC
- cron: "0 10 * * 1"
workflow_dispatch:
push:
branches:
- main
pull_request:
jobs:
get_versions:
name: Get latest versions
timeout-minutes: 1
runs-on: ubuntu-latest
outputs:
restic_versions: ${{ steps.get_restic_versions.outputs.versions }}
rclone_versions: ${{ steps.get_rclone_versions.outputs.versions }}
steps:
- name: Install dependencies
run: sudo apt-get install jq
- id: get_restic_versions
name: Get Restic versions
env:
DOCKER_IMAGE: "restic/restic"
PAGE_SIZE: ${{ vars.UPSTREAM_TAGS_PAGE_SIZE || '6' }}
run: |
versions=$(
curl -s "https://hub.docker.com/v2/repositories/${DOCKER_IMAGE}/tags?page_size=${PAGE_SIZE}&page=1" \
| jq -c '[.results[].name]'
)
echo "versions=${versions}" >> $GITHUB_OUTPUT
- id: get_rclone_versions
name: Get Rclone versions
env:
DOCKER_IMAGE: "rclone/rclone"
PAGE_SIZE: ${{ vars.UPSTREAM_TAGS_PAGE_SIZE || '6' }}
run: |
versions=$(
curl -s "https://hub.docker.com/v2/repositories/${DOCKER_IMAGE}/tags?page_size=${PAGE_SIZE}&page=1" \
| jq -c '[.results[].name]'
)
echo "versions=${versions}" >> $GITHUB_OUTPUT
build-and-push:
name: Build and push images
uses: ./.github/workflows/build-and-push.yaml
permissions:
contents: read
id-token: write
packages: write
secrets: inherit
needs:
- get_versions
with:
restic_versions: ${{ needs.get_versions.outputs.restic_versions }}
rclone_versions: ${{ needs.get_versions.outputs.rclone_versions }}