-
Notifications
You must be signed in to change notification settings - Fork 12
93 lines (85 loc) · 3.07 KB
/
ci-images.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
name: Rebuild CI images
# NOTE(mikal): git repos are checked out to /srv/github/_work/{repo}/{repo}
# which is available as GITHUB_WORKSPACE. You can find other environment
# variables at https://docs.github.com/en/actions/learn-github-actions/environment-variables
on:
workflow_dispatch:
schedule:
- cron: '11 0 * * *' # utc
jobs:
image_build_matrix:
name: "${{ matrix.os.name }}"
strategy:
fail-fast: false
matrix:
os: [
{
'name': 'debian-11',
'baseimage': 'debian:11',
'baseuser': 'debian',
'outputlabel': 'ci-images/debian-11',
'scheduled': True
},
{
'name': 'debian-12',
'baseimage': 'debian:12',
'baseuser': 'debian',
'outputlabel': 'ci-images/debian-12',
'scheduled': True
},
{
'name': 'rocky-9',
'baseimage': 'rocky:9',
'baseuser': 'cloud-user',
'outputlabel': 'ci-images/rocky-9',
'scheduled': True
},
{
'name': 'ubuntu-2004',
'baseimage': 'ubuntu:20.04',
'baseuser': 'ubuntu',
'outputlabel': 'ci-images/ubuntu-2004',
'scheduled': True
},
{
'name': 'ubuntu-2204',
'baseimage': 'ubuntu:22.04',
'baseuser': 'ubuntu',
'outputlabel': 'ci-images/ubuntu-2204',
'scheduled': True
},
]
runs-on: [self-hosted, vm]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os.name }}
cancel-in-progress: true
steps:
- name: Set environment variables
run: |
echo "SHAKENFIST_NAMESPACE=$(hostname)" >> $GITHUB_ENV
- name: Checkout the actions repository
uses: actions/checkout@v4
with:
repository: shakenfist/actions
path: actions
fetch-depth: 0
- name: Build image
run: |
cd ${GITHUB_WORKSPACE}/actions
ansible-playbook -i /home/debian/ansible-hosts \
--extra-vars "identifier=${SHAKENFIST_NAMESPACE} source_path=${GITHUB_WORKSPACE} \
base_image=${{ matrix.os.baseimage }} base_image_user=${{ matrix.os.baseuser }} label=${{ matrix.os.outputlabel }}" \
ansible/ci-image.yml
- uses: JasonEtco/create-an-issue@v2
if: failure()
id: create-issue
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SF_CI_NAME: ${{ matrix.os.name }}
SF_ACTION_RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
filename: shakenfist/.github/workflows/ci-images-failure.md
update_existing: true
search_existing: open
- if: failure()
run: 'echo Created ${{ steps.create-issue.outputs.url }}'