This repository has been archived by the owner on Oct 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
107 lines (94 loc) · 3.25 KB
/
aws-ubuntu-22_04.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: "aws-04-build-toolset-image"
on:
workflow_dispatch:
inputs:
instanceType:
description: "The instance type used to build the AMI"
required: true
type: choice
options:
- c4.xlarge
- t3a.xlarge
default: "t3a.xlarge"
region:
description: "The AWS region where the AMI will be available"
required: true
type: choice
options:
- us-east-1
- us-east-2
- us-west-2
- af-south-1
- ap-east-1
- ap-south-1
- ap-northeast-1
- ap-northeast-2
- ap-northeast-3
- ap-southeast-1
- ap-southeast-2
- ca-central-1
- eu-west-1
- eu-west-2
- eu-west-3
- eu-north-1
- eu-south-1
- me-south-1
- sa-east-1
default: "us-west-2"
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Copy init.sh
uses: canastro/copy-file-action@master
with:
source: "scripts/init.sh"
target: "packer/aws/ubuntu/22_04/init.sh"
- name: Copy inventory.sh
uses: canastro/copy-file-action@master
with:
source: "scripts/inventory.sh"
target: "packer/aws/ubuntu/22_04/inventory.sh"
- name: Copy kind-load-cafile.sh
uses: canastro/copy-file-action@master
with:
source: "scripts/kind-load-cafile.sh"
target: "packer/aws/ubuntu/22_04/kind-load-cafile.sh"
- name: Copy fetch-tanzu-cli.sh
uses: canastro/copy-file-action@master
with:
source: "scripts/fetch-tanzu-cli.sh"
target: "packer/aws/ubuntu/22_04/fetch-tanzu-cli.sh"
- name: Copy fetch-and-install-oci-cli.sh
uses: canastro/copy-file-action@master
with:
source: "scripts/fetch-and-install-oci-cli.sh"
target: "packer/aws/ubuntu/22_04/fetch-and-install-oci-cli.sh"
- name: Copy install-tap-plugins.sh
uses: canastro/copy-file-action@master
with:
source: "scripts/install-tap-plugins.sh"
target: "packer/aws/ubuntu/22_04/install-tap-plugins.sh"
- name: Copy install-krew-and-plugins.sh
uses: canastro/copy-file-action@master
with:
source: "scripts/install-krew-and-plugins.sh"
target: "packer/aws/ubuntu/22_04/install-krew-and-plugins.sh"
- name: Use latest Packer
uses: hashicorp-contrib/setup-packer@v2
with:
packer-version: 1.9.4
- name: Initialize Packer
working-directory: ./packer/aws/ubuntu/22_04
run: packer init .
- name: Build image from template
working-directory: ./packer/aws/ubuntu/22_04
run: packer build -only=standard.* -var "ami_name=k8s-toolset-image" -var "instance_type=${{ github.event.inputs.instanceType }}" -var "vpc_region=${{ github.event.inputs.region }}" .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }}
AWS_REGION: ${{ github.event.inputs.region }}