-
Notifications
You must be signed in to change notification settings - Fork 0
165 lines (136 loc) · 5.29 KB
/
scheduled-images-fetch.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Scheduled Images Fetch
# This workflow represents a specific configuration for a
# single MACHINE as a specific design goal. It utilizes a
# reusable workflow found at distro-core/distro-manifest.
# Variables and Actions
# secrets.AWS_ACCESS_KEY_ID Reusable Workflow, S3 Access Key
# secrets.AWS_SECRET_ACCESS_KEY Reusable Workflow, S3 Secret Key
# secrets.AWS_ENDPOINT_URL Reusable Workflow, S3 Endpoint Hostname
# liskin/gh-workflow-keepalive Action, Keepalive
# Self hosted runners have the prerequsite dependency to
# install the host tools dependencies before workflow use.
on:
# schedule:
# - cron: '00 6 * * *'
workflow_dispatch:
# inputs:
# DISTRO:
# description: Select DISTRO
# required: true
# type: choice
# default: distro-core
# options:
# - distro-core
# - distro-core-no-gui
# TARGETS:
# description: Select Target
# required: true
# type: choice
# default: distro-image
# options:
# - distro-image
# - distro-sdk-image
# cancel previous workflow runs to avoid concurrency issues
concurrency:
group: images-fetch-${{ github.ref_name }}
cancel-in-progress: true
# workflow permissions for current repository
permissions:
actions: write
contents: write
# default shell for all jobs
defaults:
run:
shell: bash
########################################################################
jobs:
# runner-name selects a self-hosted runner and returns its name
runner-name:
uses: distro-core/distro-manifest/.github/workflows/runner-name.yml@main
# keep-alive prevents the workflow from being disabled due to any
# github repository inactivity.
keep-alive:
needs: [ runner-name ]
runs-on: ${{ needs.runner-name.outputs.runner-name }}
steps:
- uses: liskin/[email protected]
# contexts reports in the summary log contents of contexts
contexts:
needs: [ runner-name ]
uses: distro-core/distro-manifest/.github/workflows/images-contexts.yml@main
with:
runner-name: ${{ needs.runner-name.outputs.runner-name }}
# remove the workspace contents; self-hosted runners retain the
# workspace contents between jobs.
pre-cleanup:
needs: [ runner-name ]
uses: distro-core/distro-manifest/.github/workflows/images-cleanup.yml@main
with:
runner-name: ${{ needs.runner-name.outputs.runner-name }}
# DL_DIR: ${{ needs.runner-name.outputs.mnt-dl-dir }}
# SSTATE_DIR: ${{ needs.runner-name.outputs.mnt-sstate-dir }}
DISTRO: distro-core
# repo init, sync and manifest; the job creates the workspace
# contents and the .repo directory that are referenced in later
# jobs.
repo-init:
needs: [ runner-name, pre-cleanup ]
uses: distro-core/distro-manifest/.github/workflows/images-repo-init-sync.yml@main
with:
runner-name: ${{ needs.runner-name.outputs.runner-name }}
MANIFEST_URL: https://github.com/distro-core/distro-manifest.git
MANIFEST_NAME: distro-head-kirkstone.xml
MANIFEST_REF: main
# build steps to create artifacts.
build:
needs: [ runner-name, repo-init ]
uses: distro-core/distro-manifest/.github/workflows/images-build.yml@main
with:
runner-name: ${{ needs.runner-name.outputs.runner-name }}
timeout-minutes: 960
# DL_DIR: ${{ needs.runner-name.outputs.mnt-dl-dir }}
# SSTATE_DIR: ${{ needs.runner-name.outputs.mnt-sstate-dir }}
DISTRO: distro-core
MACHINE: sbc-pine64-star64
TARGETS_FETCH: distro-image
TARGETS_CLEAN:
TARGETS_BEFORE:
TARGETS:
TARGET_FLAGS:
MANIFEST_COMMIT_ID: ${{ needs.repo-init.outputs.manifest_sha }}
# deploy steps to save artifacts.
# deploy-mnt:
# needs: [ runner-name, repo-init, build ]
# uses: distro-core/distro-manifest/.github/workflows/images-deploy-mnt.yml@main
# with:
# runner-name: ${{ needs.runner-name.outputs.runner-name }}
# timeout-minutes: 360
# DL_DIR: ${{ needs.runner-name.outputs.mnt-dl-dir }}
# SSTATE_DIR: ${{ needs.runner-name.outputs.mnt-sstate-dir }}
# DISTRO: distro-core
# MACHINE: sbc-pine64-star64
# deploy-buckets:
# needs: [ runner-name, repo-init, build ]
# uses: distro-core/distro-manifest/.github/workflows/images-deploy-buckets.yml@main
# with:
# runner-name: ${{ needs.runner-name.outputs.runner-name }}
# timeout-minutes: 360
# DL_DIR: ${{ needs.runner-name.outputs.mnt-dl-dir }}
# SSTATE_DIR: ${{ needs.runner-name.outputs.mnt-sstate-dir }}
# DISTRO: distro-core
# MACHINE: sbc-pine64-star64
# secrets:
# AWS_ENDPOINT_URL: ${{ secrets.AWS_ENDPOINT_URL }}
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# remove the workspace contents; self-hosted runners retain the
# workspace contents between jobs.
post-cleanup:
needs: [ runner-name, build ]
if: always()
uses: distro-core/distro-manifest/.github/workflows/images-cleanup.yml@main
with:
runner-name: ${{ needs.runner-name.outputs.runner-name }}
# DL_DIR: ${{ needs.runner-name.outputs.mnt-dl-dir }}
# SSTATE_DIR: ${{ needs.runner-name.outputs.mnt-sstate-dir }}
DISTRO: distro-core