Skip to content

Packer build Hetzner #10

Packer build Hetzner

Packer build Hetzner #10

name: Packer build Hetzner
on:
workflow_run:
workflows: ["Build and Publish devcontainer image"]
types:
- completed
jobs:
build:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 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=${{ 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=${{ github.event.workflow_run.head_branch }} hetzner.pkr.hcl
env:
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN_PROD }}