-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (68 loc) · 2.4 KB
/
build-push-podman-remote-vm.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
name: build push podman-remote vm
on:
workflow_dispatch:
env:
LIBGUESTFS_BACKEND: direct
OS_IMAGE: https://mirror.karneval.cz/pub/linux/fedora/linux/releases/38/Cloud/x86_64/images/Fedora-Cloud-Base-38-1.6.x86_64.qcow2
jobs:
build-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install libguestfs tools
run: |
sudo apt-get update
sudo apt-get -y install libguestfs-tools
- name: Download the Fedora Cloud image
run: |
curl -L -o disk.img ${OS_IMAGE}
- name: Customize the VM
run: |
export LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1
sudo virt-customize -a disk.img --install cloud-init,podman,openssh-server,socat,qemu-guest-agent
sudo virt-customize -a disk.img \
--root-password password:test \
--run .github/resources/customize-vm -v
sudo virt-sparsify --in-place disk.img
ls -la disk.img
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: quarkus-dev-vm
tags: latest ${{ github.sha }}
containerfiles: |
.github/resources/Dockerfile
- name: Push To quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: quay.io/ch007m
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
#- name: Docker meta
# id: meta
# uses: docker/metadata-action@v5
# with:
# images: ch007m/quarkus-dev-vm
#
#- name: Login to Quay.io
# uses: docker/login-action@v3
# with:
# registry: quay.io
# username: ${{ secrets.QUAY_USERNAME }}
# password: ${{ secrets.QUAY_ROBOT_TOKEN }}
#
#- name: Build and push
# uses: docker/build-push-action@v5
# with:
# context: .
# file: .github/resources/Dockerfile
# #push: ${{ github.event_name != 'pull_request' }}
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}