forked from icon-project/IBC-Integration
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (52 loc) · 1.43 KB
/
packer-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
on:
push:
branches:
- main
paths:
- ".github/packer/*"
jobs:
start-runner:
uses: ./.github/workflows/runner-start.yml
secrets: inherit
build:
needs: start-runner
runs-on: ${{ needs.start-runner.outputs.label }}
defaults:
run:
working-directory: ./.github/packer
env:
PRODUCT_VERSION: latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Build
uses: hashicorp/setup-packer@main
with:
version: ${{ env.PRODUCT_VERSION }}
- name: Run `packer init`
id: init
run: "packer init ."
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Run `packer validate`
id: validate
run: "packer validate ."
- name: Build and Publish AMI
run: packer build -color=false .
stop-runner:
uses: ./.github/workflows/runner-stop.yml
secrets: inherit
with:
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}
needs:
- start-runner
- build