-
Notifications
You must be signed in to change notification settings - Fork 87
48 lines (41 loc) · 1.17 KB
/
build-windows-ami.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
name: Build Windows AMI
on:
workflow_dispatch:
inputs:
branch:
description: 'pytorch/test-infra branch to build from. (default: main)'
required: true
default: 'main'
skip_create_ami:
description: 'Skip creating the AMI (default: false)'
required: true
default: false
permissions:
id-token: write
contents: read
env:
PACKER_VERSION: "1.11.2"
jobs:
build-windows-ami:
runs-on: ubuntu-latest
environment: packer-build-env
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
with:
repository: pytorch/test-infra
ref: ${{ inputs.branch }}
- name: Configure AWS Credentials (PyTorch Account)
uses: aws-actions/configure-aws-credentials@v3
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::391835788720:role/gha-packer-role
- name: Setup Packer
uses: hashicorp/setup-packer@main
with:
version: ${{ env.PACKER_VERSION }}
- name: Packer Build
run: |
cd aws/ami/windows
packer init .
packer build -var 'skip_create_ami=${{ inputs.skip_create_ami }}' .