-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.32 KB
/
packer-hetzner.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
name: Packer build Hetzner
on:
workflow_run:
workflows: ["Build and Publish devcontainer image"]
types:
- completed
workflow_dispatch:
inputs:
glueops_codespace_tag:
description: 'Enter the github.com/glueops/codespaces tag to use (e.g. v0.60.0)'
required: false
jobs:
build:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup `packer`
uses: hashicorp/setup-packer@1aa358be5cf73883762b302a3a03abd66e75b232 # v3.1.0
id: setup
with:
version: 1.11.2
- name: Run `packer init`
id: init
run: packer init hetzner.pkr.hcl
- name: Run `packer build stage`
id: build_stage
run: packer build -var glueops_codespaces_container_tag=${{ inputs.glueops_codespace_tag || github.event.workflow_run.head_branch }} hetzner.pkr.hcl
env:
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN_STAGE }}
- name: Run `packer build prod`
id: build_prod
run: packer build -var glueops_codespaces_container_tag=${{ inputs.glueops_codespace_tag || github.event.workflow_run.head_branch }} hetzner.pkr.hcl
env:
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN_PROD }}