Periodic Build New Actions VM #156
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Periodic Build New Actions VM | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
build: | |
name: Build new Actions VM | |
runs-on: ubuntu-latest-8-cores | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.24.x' | |
- name: Change Ubuntu mirrors | |
uses: vegardit/fast-apt-mirror.sh@v1 | |
with: | |
exclude-current: true | |
- name: Set up QEMU | |
run : | | |
sudo apt install qemu-system-x86 xorriso qemu-system-arm qemu-efi-aarch64 | |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
sudo udevadm control --reload-rules | |
sudo udevadm trigger --name-match=kvm | |
- name: Install dependencies | |
run: cd ci/gha-runner-vm && go get . | |
- name: Install Packer | |
run: | | |
curl -LO https://releases.hashicorp.com/packer/1.12.0/packer_1.12.0_linux_amd64.zip | |
unzip packer_1.12.0_linux_amd64.zip | |
sudo mv packer /usr/local/bin/ | |
rm packer_1.12.0_linux_amd64.zip | |
packer plugin install github.com/hashicorp/oracle | |
packer plugins install github.com/hashicorp/qemu | |
packer plugins install github.com/hashicorp/azure | |
- name: Install OCI CLI | |
env: | |
OCI_CLI_USER: ${{ secrets.OCI_CLI_USER }} | |
OCI_CLI_TENANCY: ${{ secrets.OCI_CLI_TENANCY }} | |
OCI_CLI_FINGERPRINT: ${{ secrets.OCI_CLI_FINGERPRINT }} | |
OCI_CLI_KEY_CONTENT: ${{ secrets.OCI_CLI_KEY_CONTENT }} | |
OCI_CLI_REGION: ${{ secrets.OCI_CLI_REGION }} | |
run: | | |
curl -L -O https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh | |
chmod +x install.sh | |
./install.sh --accept-all-defaults | |
echo 'export PATH=$PATH:$HOME/bin' >> $GITHUB_ENV | |
export PATH=$PATH:$HOME/bin | |
oci compute image list --compartment-id ocid1.compartment.oc1..aaaaaaaa22icap66vxktktubjlhf6oxvfhev6n7udgje2chahyrtq65ga63a --operating-system runner-images --operating-system-version 123456 | |
- name: Build VM Images | |
env: | |
OCI_CLI_USER: ${{ secrets.OCI_CLI_USER }} | |
OCI_CLI_TENANCY: ${{ secrets.OCI_CLI_TENANCY }} | |
OCI_CLI_FINGERPRINT: ${{ secrets.OCI_CLI_FINGERPRINT }} | |
OCI_CLI_KEY_CONTENT: ${{ secrets.OCI_CLI_KEY_CONTENT }} | |
OCI_CLI_REGION: ${{ secrets.OCI_CLI_REGION }} | |
run: | | |
export PATH=$PATH:$HOME/bin && \ | |
cd ci/gha-runner-vm && \ | |
PACKER_LOG=1 GITHUB_PERIODIC=true go run main.go \ | |
--isoURL https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img \ | |
--arch amd64 |