Skip to content

Commit 4facdbb

Browse files
committed
Add auto build image workflow
1 parent 7b9d7b6 commit 4facdbb

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build and Publish GCE Images
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'vm/**'
9+
- '.github/workflows/build-and-publish-images.yml'
10+
workflow_dispatch:
11+
12+
jobs:
13+
build-gce-image:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
id-token: write
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Authenticate to Google Cloud
24+
id: auth
25+
uses: google-github-actions/auth@v2
26+
with:
27+
project_id: ${{ env.PROJECT_ID }}
28+
workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
29+
service_account: ${{ secrets.WIF_SERVICE_ACCOUNT }}
30+
31+
- name: Set up Cloud SDK
32+
uses: google-github-actions/setup-gcloud@v2
33+
34+
- name: Install Packer
35+
uses: hashicorp/setup-packer@main
36+
with:
37+
version: "latest"
38+
39+
- name: Build GCE image with Packer
40+
working-directory: vm
41+
run: |
42+
make build-actions-runner-image

0 commit comments

Comments
 (0)