-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (45 loc) · 1.48 KB
/
build-and-publish-image.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
name: 'Build and Publish democluster to s3'
on:
push:
branches:
- main
jobs:
build-image-in-lxd:
name: build-image-in-lxd
runs-on: self-hosted
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Setup lxd controller
run: |
sudo snap install lxd --channel=latest/stable
sudo snap refresh lxd --channel=latest/stable
sudo lxd waitready
sudo lxd init --auto
sudo chmod a+wr /var/snap/lxd/common/lxd/unix.socket
lxc network set lxdbr0 ipv6.address none
sudo usermod -a -G lxd $USER
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.11"
architecture: "x64"
- name: Setup poetry
uses: Gr1N/setup-poetry@v8
- name: Install image-factory
run: |
poetry env use "3.11"
poetry install
- name: Build democluster image
run: |
poetry run image-factory build democluster
- name: Sync democluster image to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
run: |
sudo apt install awscli -y
aws s3 sync democluster/final \
s3://omnivector-public-assets/cloud-images/democluster/latest \
--acl public-read --follow-symlinks --delete 1> /dev/null