Use separate workflows for generating images
This commit is contained in:
parent
9c4313c3a4
commit
7d88f09bb0
@ -1,14 +1,14 @@
|
|||||||
name: Generate images
|
name: Debian images
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- 'tools/**'
|
- 'tools/qemu-debian-img/**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
images:
|
images:
|
||||||
name: Images
|
name: Generate Debian images
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: digitalocean/action-doctl@v2
|
- uses: digitalocean/action-doctl@v2
|
||||||
@ -20,11 +20,11 @@ jobs:
|
|||||||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
|
||||||
- name: create droplet
|
- name: create droplet
|
||||||
run: doctl compute droplet create --ssh-keys='b4:4c:66:7d:be:19:25:43:1c:e0:02:61:9f:49:12:94' --tag-name=github-actions ga-out-of-tree-$GITHUB_SHA --size s-1vcpu-1gb --image ubuntu-22-04-x64 --wait
|
run: doctl compute droplet create --ssh-keys='b4:4c:66:7d:be:19:25:43:1c:e0:02:61:9f:49:12:94' --tag-name=github-actions ga-out-of-tree-images-debian-$GITHUB_SHA --size s-1vcpu-1gb --image ubuntu-22-04-x64 --wait
|
||||||
|
|
||||||
- name: generate images
|
- name: generate images
|
||||||
run: |
|
run: |
|
||||||
IP=$(doctl compute droplet list --tag-name=github-actions --format "Name,Public IPv4" | grep -v ID | grep ga-out-of-tree-$GITHUB_SHA | awk '{print $2}')
|
IP=$(doctl compute droplet list --tag-name=github-actions --format "Name,Public IPv4" | grep -v ID | grep ga-out-of-tree-images-debian-$GITHUB_SHA | awk '{print $2}')
|
||||||
sleep 1m
|
sleep 1m
|
||||||
ssh -o StrictHostKeyChecking=accept-new root@$IP pkill apt-get
|
ssh -o StrictHostKeyChecking=accept-new root@$IP pkill apt-get
|
||||||
ssh root@$IP apt-get update
|
ssh root@$IP apt-get update
|
||||||
@ -36,4 +36,4 @@ jobs:
|
|||||||
|
|
||||||
- name: delete droplet
|
- name: delete droplet
|
||||||
if: always()
|
if: always()
|
||||||
run: doctl compute droplet delete -f ga-out-of-tree-$GITHUB_SHA
|
run: doctl compute droplet delete -f ga-out-of-tree-images-debian-$GITHUB_SHA
|
39
.github/workflows/images-oraclelinux.yml
vendored
Normal file
39
.github/workflows/images-oraclelinux.yml
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
name: Oracle Linux images
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'tools/qemu-oraclelinux-img/**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
images-oraclelinux:
|
||||||
|
name: Generate Oracle Linux images
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: digitalocean/action-doctl@v2
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
|
||||||
|
|
||||||
|
- uses: webfactory/ssh-agent@v0.8.0
|
||||||
|
with:
|
||||||
|
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
- name: create droplet
|
||||||
|
run: doctl compute droplet create --ssh-keys='b4:4c:66:7d:be:19:25:43:1c:e0:02:61:9f:49:12:94' --tag-name=github-actions ga-out-of-tree-images-oraclelinux-$GITHUB_SHA --size s-1vcpu-1gb --image ubuntu-22-04-x64 --wait
|
||||||
|
|
||||||
|
- name: generate images
|
||||||
|
run: |
|
||||||
|
IP=$(doctl compute droplet list --tag-name=github-actions --format "Name,Public IPv4" | grep -v ID | grep ga-out-of-tree-images-oraclelinux-$GITHUB_SHA | awk '{print $2}')
|
||||||
|
sleep 1m
|
||||||
|
ssh -o StrictHostKeyChecking=accept-new root@$IP pkill apt-get
|
||||||
|
ssh root@$IP apt-get update
|
||||||
|
ssh root@$IP apt-get install -y git podman s3cmd
|
||||||
|
ssh root@$IP git clone https://github.com/out-of-tree/out-of-tree
|
||||||
|
ssh root@$IP "cd out-of-tree && git checkout $GITHUB_SHA"
|
||||||
|
ssh root@$IP ./out-of-tree/tools/qemu-oraclelinux-img/generate-images.sh
|
||||||
|
ssh root@$IP "s3cmd put ./out-of-tree/tools/qemu-oraclelinux-img/*.tar.gz s3://out-of-tree/1.0.0 --host=fra1.digitaloceanspaces.com --access_key=${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }} --secret_key=${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}"
|
||||||
|
|
||||||
|
- name: delete droplet
|
||||||
|
if: always()
|
||||||
|
run: doctl compute droplet delete -f ga-out-of-tree-images-oraclelinux-$GITHUB_SHA
|
Loading…
Reference in New Issue
Block a user