2023-11-17 10:36:31 +00:00
|
|
|
name: Hetzner Cloud template
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
hetzner-cloud-template:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
2023-12-20 22:13:52 +00:00
|
|
|
- uses: hashicorp/setup-terraform@v3
|
2023-11-17 10:36:31 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: '0'
|
|
|
|
- name: Validate
|
|
|
|
working-directory: ./hetzner-cloud
|
|
|
|
run: |
|
|
|
|
terraform init
|
|
|
|
terraform validate
|
|
|
|
- name: Deploy Hetzner Cloud template
|
2024-11-07 04:11:31 +00:00
|
|
|
uses: docker://ghcr.io/coder/coder:v2.17.0-arm64
|
2023-11-17 10:36:31 +00:00
|
|
|
with:
|
|
|
|
entrypoint: /opt/coder
|
|
|
|
args: |
|
|
|
|
templates push \
|
|
|
|
--name "${{ github.sha }}" \
|
|
|
|
--directory "hetzner-cloud" \
|
|
|
|
--variable hcloud_token="${{ secrets.HCLOUD_TOKEN }}" \
|
|
|
|
--variable use_subdomain=true \
|
|
|
|
--variable private_network_id="${{ secrets.HCLOUD_PRIVATE_NETWORK_ID }}" \
|
|
|
|
--yes \
|
|
|
|
"Hetzner-Cloud"
|
|
|
|
env:
|
|
|
|
CODER_URL: https://ide.icb4dc0.de
|
|
|
|
CODER_SESSION_TOKEN: "${{ secrets.CODER_TOKEN }}"
|