-
Notifications
You must be signed in to change notification settings - Fork 1
115 lines (94 loc) · 3.96 KB
/
publish-images.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
108
109
110
111
112
113
114
115
name: Publish AMIs
on:
repository_dispatch:
types:
- publish_amis
jobs:
ubuntu-20-04:
name: Publish Ubuntu 20.04 AMI
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEPLOYMENT_REGION }}
steps:
- uses: actions/checkout@v2
- name: Install packer
uses: hashicorp-contrib/setup-packer@v1
- name: Publish Ubuntu-20.04 AMI
working-directory: aws/ubuntu/ubuntu-20-04
run: |
packer init -upgrade ubuntu-focal.pkr.hcl
packer build -var-file="config.auto.pkrvars.hcl" .
- name: Failure Slack notification
if: ${{ failure() }}
run: |
curl -X POST -H 'Content-type: application/json' \
--data '{"text": "@invalidators Failed to build and release the Ubuntu 20.04 Packer AMI. Please check the workflow logs in Infrastructure-templates repository."}' \
${{ secrets.SLACK_WEBHOOK_TIDAL_TOOLS }}
ubuntu-18-04:
name: Publish Ubuntu 18.04 AMI
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEPLOYMENT_REGION }}
steps:
- uses: actions/checkout@v2
- name: Install packer
uses: hashicorp-contrib/setup-packer@v1
- name: Publish Ubuntu-18.04 AMI
working-directory: aws/ubuntu/ubuntu-18-04
run: |
packer init -upgrade ubuntu-bionic.pkr.hcl
packer build -var-file="config.auto.pkrvars.hcl" .
- name: Failure Slack notification
if: ${{ failure() }}
run: |
curl -X POST -H 'Content-type: application/json' \
--data '{"text": "@invalidators Failed to build and release the Ubuntu 18.04 Packer AMI. Please check the workflow logs in Infrastructure-templates repository."}' \
${{ secrets.SLACK_WEBHOOK_TIDAL_TOOLS }}
rhel-7:
name: Publish RHEL7 AMI
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEPLOYMENT_REGION }}
steps:
- uses: actions/checkout@v2
- name: Install packer
uses: hashicorp-contrib/setup-packer@v1
- name: Publish RHEL7 AMI
working-directory: aws/rhel/rhel7
run: |
packer init -upgrade rhel7.pkr.hcl
packer build -var-file="config.auto.pkrvars.hcl" .
- name: Failure Slack notification
if: ${{ failure() }}
run: |
curl -X POST -H 'Content-type: application/json' \
--data '{"text": "@invalidators Failed to build and release the RHEL7 Packer AMI. Please check the workflow logs in Infrastructure-templates repository."}' \
${{ secrets.SLACK_WEBHOOK_TIDAL_TOOLS }}
windows-server-2019:
name: Publish Windows Server 2019 AMI
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEPLOYMENT_REGION }}
steps:
- uses: actions/checkout@v2
- name: Install packer
uses: hashicorp-contrib/setup-packer@v1
- name: Publish Windows Server 2019 AMI
working-directory: aws/windows/windows-server-2019
run: |
packer init -upgrade windows-server-2019.pkr.hcl
packer build -var-file="config.auto.pkrvars.hcl" .
- name: Failure Slack notification
if: ${{ failure() }}
run: |
curl -X POST -H 'Content-type: application/json' \
--data '{"text": "@invalidators Failed to build and release the Windows Server 2019 Packer AMI. Please check the workflow logs in Infrastructure-templates repository."}' \
${{ secrets.SLACK_WEBHOOK_TIDAL_TOOLS }}