Skip to content

Build Runner EC2 Images #5

Build Runner EC2 Images

Build Runner EC2 Images #5

name: Build Runner EC2 Images
on:
schedule:
# 00:00 on Monday each week
- cron: "0 0 * * 1"
workflow_dispatch:
jobs:
build-image:
name: Build
runs-on: ubuntu-latest
defaults:
run:
working-directory: packer/github-actions-runner
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::${{ vars.RUNNER_ACCOUNT }}:role/github-to-aws-oidc
aws-region: us-east-1
- name: Setup `packer`
uses: hashicorp/setup-packer@main
id: setup
with:
version: "latest"
- name: Run `packer init`
id: init
run: packer init .
- name: Run `packer validate`
id: validate
run: packer validate .
- name: Packer Build
id: build
run: packer build -color=false -on-error=cleanup build.pkr.hcl