-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (87 loc) · 2.84 KB
/
tofu.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: tofu
on:
push:
branches:
- "main"
schedule:
- cron: "0 * * * *"
concurrency:
group: ${{ github.workflow }}
jobs:
linode:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: opentofu/setup-opentofu@v1
- uses: bitwarden/sm-action@v2
with:
access_token: ${{ secrets.BW_ACCESS_TOKEN }}
base_url: https://vault.bitwarden.com
secrets: |
953077e4-dbec-4595-a0d7-b1d400d8adc6 > DISCORD_WEBHOOK
1c579b93-ac50-47a9-85e1-b1c500b40dd5 > LINODE_TOKEN
b7d22a8b-8185-4d62-8bf6-b1d400b87552 > PG_CONN_STR
- run: |
tofu -chdir=./terraform/linode init -upgrade
- run: |
tofu -chdir=./terraform/linode \
apply -auto-approve -input=false -lock=true -no-color \
-var=kubeconfig=lke.yaml
- uses: rjstone/discord-webhook-notify@v1
if: success()
with:
severity: info
details: "[linode] apply succesfull"
webhookUrl: ${{ env.DISCORD_WEBHOOK }}
- uses: rjstone/discord-webhook-notify@v1
if: failure()
with:
severity: error
details: "[linode] apply failed"
webhookUrl: ${{ env.DISCORD_WEBHOOK }}
- uses: rjstone/discord-webhook-notify@v1
if: cancelled()
with:
severity: warn
details: "[linode] apply cancelled"
webhookUrl: ${{ env.DISCORD_WEBHOOK }}
oci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bitwarden/sm-action@v2
with:
access_token: ${{ secrets.BW_ACCESS_TOKEN }}
base_url: https://vault.bitwarden.com
secrets: |
953077e4-dbec-4595-a0d7-b1d400d8adc6 > DISCORD_WEBHOOK
b7d22a8b-8185-4d62-8bf6-b1d400b87552 > PG_CONN_STR
8c29761d-9f79-44f1-97a1-b1d400b70984 > TF_VAR_private_key
fdc9cf76-3eed-4173-9e66-b1d400b74aaf > TF_VAR_fingerprint
f65d2583-7fe2-4ead-a4fa-b1d400b72191 > TF_VAR_tenancy_ocid
be76a461-2f01-49b8-a106-b1d400b735f4 > TF_VAR_user_ocid
b2b149a9-1a9c-4a45-b3c6-b1d400b48405 > TF_VAR_ssh_public_keys
- uses: opentofu/setup-opentofu@v1
- run: |
tofu -chdir=./terraform/oci init -upgrade
- run: |
tofu -chdir=./terraform/oci \
apply -auto-approve -input=false -lock=true -no-color
- uses: rjstone/discord-webhook-notify@v1
if: success()
with:
severity: info
details: "[oci] apply succesfull"
webhookUrl: ${{ env.DISCORD_WEBHOOK }}
- uses: rjstone/discord-webhook-notify@v1
if: failure()
with:
severity: error
details: "[oci] apply failed"
webhookUrl: ${{ env.DISCORD_WEBHOOK }}
- uses: rjstone/discord-webhook-notify@v1
if: cancelled()
with:
severity: warn
details: "[oci] apply cancelled"
webhookUrl: ${{ env.DISCORD_WEBHOOK }}