-
Notifications
You must be signed in to change notification settings - Fork 6
67 lines (58 loc) · 1.42 KB
/
update-packer-vm.yaml
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
---
name: Update packer images
on:
workflow_dispatch:
push:
branches:
- main
- master
paths-ignore:
- ./.github/**
- ./terraform/**
pull_request:
paths-ignore:
- ./.github/**
- ./terraform/**
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
create-gcp-image:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- run: |
sudo apt-get update
sudo apt-get install -y packer
shell: bash
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: 'Use gcloud CLI'
run: gcloud info
shell: bash
- name: Validate packer
run: packer validate ./gcp-packer.json
shell: bash
working-directory: packer
- name: Build instance
if: github.event_name != 'pull_request'
run: |
packer build -force -color=false ./gcp-packer.json
shell: bash
working-directory: packer
test-image:
needs:
- create-gcp-image
uses: ./.github/workflows/call-run-performance-test.yaml
with:
vm-name: packer-test
duration: 1
secrets:
service-account: ${{ secrets.GCP_SA_KEY }}