From 3cb166b6bc456e5ab06d3cf8ea1546a48533994f Mon Sep 17 00:00:00 2001 From: Peter Kurfer Date: Fri, 17 Nov 2023 11:36:31 +0100 Subject: [PATCH] ci: switch to Gitea actions --- .gitea/workflows/renovate.yaml | 22 +++++++++++++++++++ .gitea/workflows/terraform.yaml | 39 +++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .gitea/workflows/renovate.yaml create mode 100644 .gitea/workflows/terraform.yaml diff --git a/.gitea/workflows/renovate.yaml b/.gitea/workflows/renovate.yaml new file mode 100644 index 0000000..208cc23 --- /dev/null +++ b/.gitea/workflows/renovate.yaml @@ -0,0 +1,22 @@ +name: Renovate +on: + push: + branches: + - main + schedule: + - cron: '11 4 * * *' + +jobs: + renovate: + runs-on: ubuntu-latest + steps: + - uses: docker://code.icb4dc0.de/infrastructure/images/renovate:latest + with: + args: renovate "${{ github.repository }}" + env: + RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }} + GITHUB_COM_TOKEN: ${{ secrets.RENOVATE_GITHUB_TOKEN }} + RENOVATE_PLATFORM: gitea + RENOVATE_AUTODISCOVER: "false" + RENOVATE_ENDPOINT: https://code.icb4dc0.de/api/v1 + LOG_LEVEL: info \ No newline at end of file diff --git a/.gitea/workflows/terraform.yaml b/.gitea/workflows/terraform.yaml new file mode 100644 index 0000000..efe1e83 --- /dev/null +++ b/.gitea/workflows/terraform.yaml @@ -0,0 +1,39 @@ +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 + - uses: hashicorp/setup-terraform@v2 + with: + fetch-depth: '0' + - name: Validate + working-directory: ./hetzner-cloud + run: | + terraform init + terraform validate + - name: Deploy Hetzner Cloud template + uses: docker://ghcr.io/coder/coder:v2.3.3-arm64 + 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 }}" \ No newline at end of file