import state from scaleway s3 storage
Some checks failed
Deployment / deploy-docker (push) Failing after 10s

This commit is contained in:
Melchior Reimers
2026-02-04 20:47:56 +01:00
parent d47916eff2
commit aac4e86ca0
2 changed files with 43 additions and 1 deletions

View File

@@ -12,6 +12,11 @@ jobs:
env: env:
SSH_PUBLIC_KEY: ${{ secrets.SSH_PUBLIC_KEY }} SSH_PUBLIC_KEY: ${{ secrets.SSH_PUBLIC_KEY }}
HETZNER_TOKEN: ${{ secrets.HETZNER_TOKEN }} HETZNER_TOKEN: ${{ secrets.HETZNER_TOKEN }}
S3_BUCKET: ${{ secrets.S3_BUCKET }}
S3_REGION: ${{ secrets.S3_REGION }}
S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
run: | run: |
set -e set -e
if [ -z "$SSH_PUBLIC_KEY" ]; then if [ -z "$SSH_PUBLIC_KEY" ]; then
@@ -22,6 +27,26 @@ jobs:
echo "Missing HETZNER_TOKEN secret" echo "Missing HETZNER_TOKEN secret"
exit 1 exit 1
fi fi
if [ -z "$S3_BUCKET" ]; then
echo "Missing S3_BUCKET secret"
exit 1
fi
if [ -z "$S3_REGION" ]; then
echo "Missing S3_REGION secret"
exit 1
fi
if [ -z "$S3_ENDPOINT" ]; then
echo "Missing S3_ENDPOINT secret"
exit 1
fi
if [ -z "$S3_ACCESS_KEY" ]; then
echo "Missing S3_ACCESS_KEY secret"
exit 1
fi
if [ -z "$S3_SECRET_KEY" ]; then
echo "Missing S3_SECRET_KEY secret"
exit 1
fi
python - <<'PY' python - <<'PY'
import os import os
token = os.environ.get("HETZNER_TOKEN", "") token = os.environ.get("HETZNER_TOKEN", "")
@@ -37,6 +62,12 @@ jobs:
env: env:
HETZNER_TOKEN: ${{ secrets.HETZNER_TOKEN }} HETZNER_TOKEN: ${{ secrets.HETZNER_TOKEN }}
SSH_KEY: ${{ secrets.SSH_PUBLIC_KEY }} SSH_KEY: ${{ secrets.SSH_PUBLIC_KEY }}
S3_BUCKET: ${{ secrets.S3_BUCKET }}
S3_REGION: ${{ secrets.S3_REGION }}
S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
S3_KEY: ${{ secrets.S3_KEY }}
run: | run: |
set -e set -e
# Kopiere das Template und ersetze die Platzhalter mit sed # Kopiere das Template und ersetze die Platzhalter mit sed
@@ -52,7 +83,17 @@ jobs:
Path("terraform.tfvars").write_text(content) Path("terraform.tfvars").write_text(content)
PY PY
terraform init terraform init \
-backend-config="bucket=$S3_BUCKET" \
-backend-config="key=${S3_KEY:-hetzner/terraform.tfstate}" \
-backend-config="region=$S3_REGION" \
-backend-config="endpoint=$S3_ENDPOINT" \
-backend-config="access_key=$S3_ACCESS_KEY" \
-backend-config="secret_key=$S3_SECRET_KEY" \
-backend-config="skip_credentials_validation=true" \
-backend-config="skip_region_validation=true" \
-backend-config="skip_metadata_api_check=true" \
-backend-config="force_path_style=true"
terraform apply -auto-approve terraform apply -auto-approve
echo "Deployment successful" echo "Deployment successful"

View File

@@ -5,6 +5,7 @@ terraform {
version = "~> 1.45" version = "~> 1.45"
} }
} }
backend "s3" {}
} }
provider "hcloud" { provider "hcloud" {