chore: Add tofu workflows #1

Open
Peter wants to merge 25 commits from pgi-add-workflows into main
Showing only changes of commit d7bf58060e - Show all commits

View file

@ -10,6 +10,8 @@ on:
# - pve01.wheatley.in/k8s-wheatley/**
env:
TOFU_VERSION: 1.10.7
TOFU_CHECKSUM: 765a7374aeafcad15fe8da5359de76ce11ba0fd3cb6c2dc85d3b390e6362cae5
TOFU_DIR: pve01.wheatley.in/k8s-wheatley
AWS_S3_ENDPOINT: ${{ secrets.AWS_S3_ENDPOINT }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
@ -20,11 +22,37 @@ env:
jobs:
tofu-plan-k8s-wheatley:
runs-on: docker
container:
image: ghcr.io/opentofu/opentofu:1.10.7
steps:
- uses: actions/checkout@v4
- name: Download OpenTofu
id: download
run: |
set -eo pipefail
echo "Downloading OpenTofu..."
curl -L https://github.com/opentofu/opentofu/releases/download/v{{ env.TOFU_VERSION }}/tofu_{{ env.TOFU_VERSION }}_linux_amd64.tar.gz
echo "Downloaded OpenTofu ✅"
echo "Verifying checksum..."
if echo "{{ env.TOFU_CHECKSUM }} tofu_{{ env.TOFU_VERSION }}_linux_amd64.tar.gz" | sha256sum --check --status; then
echo "Checksum OK ✅"
else
echo "Checksum mismatch! ❌"
exit 1
working-directory: /tmp/tofu
- name: Install OpenTofu
run: |
echo "Untarring..."
tar -xzf tofu_{{ env.TOFU_VERSION }}_linux_amd64.tar.gz
echo "Untarring ✅"
echo "Installing OpenTofu Binary..."
mv tofu /usr/local/bin/tofu
chmod +x /usr/local/bin/tofu
echo "Installed Open Tofu ✅ Installed version:"
tofu version
working-directory: /tmp/tofu
- name: OpenTofu fmt
id: fmt
run: tofu fmt -check