Build Runner EC2 Images #5
This file contains 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: 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 |