Skip to content

Fix generate new node id and bls info (#2237) #49

Fix generate new node id and bls info (#2237)

Fix generate new node id and bls info (#2237) #49

name: build-public-ami
on:
schedule:
- cron: '10 10 * * 1'
push:
tags:
- "*"
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
env:
PACKER_VERSION: "1.11.2"
jobs:
build-public-ami-and-upload:
name: Build Public AMIs for AWS and GCP
runs-on: ubuntu-22.04
timeout-minutes: 45
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install npx aws-amicleaner
run: npm install -g aws-amicleaner
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: us-east-1
- name: Clean up old AMIs
run: npx aws-amicleaner --include-name 'public-avalanchecli-ubuntu-*' --exclude-newest 1 --exclude-days 2 --region="*" --force
env:
AWS_REGION: us-east-1
- name: Configure GCP credentials
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.EXPERIMENTAL_GCP_SA_KEY_PACKER }}
- name: Setup `packer`
uses: hashicorp/setup-packer@main
id: setup
with:
version: ${{ env.PACKER_VERSION }}
- name: Run `packer init`
id: init
run: "packer init ./.github/packer/aws-ubuntu-docker.pkr.hcl"
- name: Run `packer validate`
id: validate
run: "packer validate ./.github/packer/aws-ubuntu-docker.pkr.hcl"
- name: Run `packer build`
id: build
run: "packer build -color=false -force ./.github/packer/aws-ubuntu-docker.pkr.hcl"