feature: create dedicated dev environment (#116) #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
paths: | |
- ".github/workflows/base-image.yml" | |
- "infrastructure/packer/**/*" | |
- "infrastructure/ansible/**/*" | |
name: Base Image | |
jobs: | |
build-image: | |
name: Build Hetzner Image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Setup `packer` | |
uses: hashicorp/setup-packer@main | |
id: setup | |
with: | |
version: v1.10.3 | |
- name: Run `packer init` | |
id: init | |
working-directory: infrastructure/packer/ | |
run: "packer init ./manifests/basic_gameserver.pkr.hcl" | |
- name: Run `packer validate` | |
id: validate | |
working-directory: infrastructure/packer/ | |
run: "packer validate ./manifests/basic_gameserver.pkr.hcl" | |
env: | |
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }} | |
# build artifact | |
- name: Build Packer image | |
working-directory: infrastructure/packer/ | |
run: packer build -color=false -on-error=abort -var-file ./vars/production.hcl ./manifests/basic_gameserver.pkr.hcl | |
env: | |
PACKER_LOG: 1h | |
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }} |