-
Notifications
You must be signed in to change notification settings - Fork 0
/
packer_release.yml
48 lines (38 loc) · 1.4 KB
/
packer_release.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: Release
on:
release:
types:
- created
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
HCP_CLIENT_ID: ${{ secrets.HCP_CLIENT_ID }}
HCP_CLIENT_SECRET: ${{ secrets.HCP_CLIENT_SECRET }}
jobs:
build:
runs-on: ubuntu-20.04
name: packer-build
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install packer and ansible
run: |
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - && \
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" && \
sudo apt-get update && sudo apt-get install -y packer ansible
# init plugins
- name: Init Plugins
run: packer init packer/
# build artifact
- name: Build Artifact
run: packer build -color=false -on-error=abort packer/
env:
PACKER_LOG: 1
PACKER_LOG_PATH: /tmp/packer.log
PKR_VAR_release: ${{ github.event.release.tag_name }}
- name: Salva logs do Packer
uses: actions/upload-artifact@v2
with:
name: packer-logs
path: /tmp/packer.log