Skip to content

Nightly Build Ubuntu 22.04 Image #14

Nightly Build Ubuntu 22.04 Image

Nightly Build Ubuntu 22.04 Image #14

name: Nightly Build Ubuntu 22.04 Image
on:
schedule:
- cron: '0 2 * * *' # Runs at 2 AM UTC every day
workflow_dispatch: # Allows manual triggering
permissions:
contents: read
packages: write
jobs:
build-and-push:
runs-on: ubuntu-latest-8-cores
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Packer
uses: hashicorp/setup-packer@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Initialize Packer
run: packer init images/ubuntu/templates/ubuntu-22.04.pkr.hcl
- name: Build Packer Image
run: packer build images/ubuntu/templates/ubuntu-22.04.pkr.hcl
- name: Push Docker image
run: |
docker push ghcr.io/${{ github.repository }}:ubuntu-22.04-latest
docker push ghcr.io/${{ github.repository }}:ubuntu-22.04-nightly-$(date +'%Y%m%d')