stage #19
@@ -1,5 +1,4 @@
|
|||||||
name: Gitea Actions Demo
|
name: Terraform Apply
|
||||||
run-name: ${{ gitea.actor }} is deploying with Terraform 🚀
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -11,20 +10,20 @@ jobs:
|
|||||||
name: "Terraform Apply"
|
name: "Terraform Apply"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
env:
|
|
||||||
TF_VAR_SSH_KEY_PUBLIC: ${{ secrets.SSH_KEY_PUBLIC }}
|
|
||||||
TF_VAR_TS_AUTHKEY: ${{ secrets.TS_AUTHKEY }}
|
|
||||||
TF_VAR_pm_api_token_id: ${{ secrets.PM_API_TOKEN_ID }}
|
|
||||||
TF_VAR_pm_api_token_secret: ${{ secrets.PM_API_TOKEN_SECRET }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Create secrets.tfvars
|
||||||
|
working-directory: terraform
|
||||||
|
run: |
|
||||||
|
cat > secrets.auto.tfvars << EOF
|
||||||
|
pm_api_token_id = "${{ secrets.PM_API_TOKEN_ID }}"
|
||||||
|
pm_api_token_secret = "${{ secrets.PM_API_TOKEN_SECRET }}"
|
||||||
|
SSH_KEY_PUBLIC = "${{ secrets.SSH_KEY_PUBLIC }}"
|
||||||
|
TS_AUTHKEY = "${{ secrets.TS_AUTHKEY }}"
|
||||||
|
EOF
|
||||||
|
|
||||||
- name: Set up Terraform
|
- name: Set up Terraform
|
||||||
uses: hashicorp/setup-terraform@v2
|
uses: hashicorp/setup-terraform@v2
|
||||||
with:
|
with:
|
||||||
@@ -41,4 +40,3 @@ jobs:
|
|||||||
- name: Terraform Apply
|
- name: Terraform Apply
|
||||||
working-directory: terraform
|
working-directory: terraform
|
||||||
run: terraform apply -auto-approve
|
run: terraform apply -auto-approve
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
name: Gitea Actions Demo
|
name: Terraform Plan
|
||||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -12,20 +11,20 @@ jobs:
|
|||||||
name: "Terraform Plan"
|
name: "Terraform Plan"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
env:
|
|
||||||
TF_VAR_SSH_KEY_PUBLIC: ${{ secrets.SSH_KEY_PUBLIC }}
|
|
||||||
TF_VAR_TS_AUTHKEY: ${{ secrets.TS_AUTHKEY }}
|
|
||||||
TF_VAR_pm_api_token_id: ${{ secrets.PM_API_TOKEN_ID }}
|
|
||||||
TF_VAR_pm_api_token_secret: ${{ secrets.PM_API_TOKEN_SECRET }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Create secrets.tfvars
|
||||||
|
working-directory: terraform
|
||||||
|
run: |
|
||||||
|
cat > secrets.auto.tfvars << EOF
|
||||||
|
pm_api_token_id = "${{ secrets.PM_API_TOKEN_ID }}"
|
||||||
|
pm_api_token_secret = "${{ secrets.PM_API_TOKEN_SECRET }}"
|
||||||
|
SSH_KEY_PUBLIC = "${{ secrets.SSH_KEY_PUBLIC }}"
|
||||||
|
TS_AUTHKEY = "${{ secrets.TS_AUTHKEY }}"
|
||||||
|
EOF
|
||||||
|
|
||||||
- name: Set up Terraform
|
- name: Set up Terraform
|
||||||
uses: hashicorp/setup-terraform@v2
|
uses: hashicorp/setup-terraform@v2
|
||||||
with:
|
with:
|
||||||
@@ -52,4 +51,3 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: terraform-plan
|
name: terraform-plan
|
||||||
path: terraform/tfplan
|
path: terraform/tfplan
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user