-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (39 loc) · 1.35 KB
/
ci.yml
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
name: ci
on:
push:
branches:
- main
jobs:
deploy:
environment: production
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: azure/login@8c334a195cbb38e46038007b304988d888bf676a # pin@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: hashicorp/setup-terraform@ed3a0531877aca392eb870f440d9ae7aba83a6bd # pin@v1
with:
terraform_version: 1.1.7
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
- name: Terraform init
working-directory: terraform/
run: terraform init
- name: Terraform apply
working-directory: terraform/
env:
# Creds
TF_VAR_CLIENT_ID: ${{ secrets.CLIENT_ID }}
TF_VAR_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
TF_VAR_SUBSCRIPTION_ID: ${{ secrets.SUBSCRIPTION_ID }}
TF_VAR_TENANT_ID: ${{ secrets.TENANT_ID }}
run: terraform apply -auto-approve
- name: SSH Remote Deploy
uses: appleboy/ssh-action@029f5b4aeeeb58fdfe1410a5d17f967dacf36262 # [email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script_stop: true
script: ~/status/script/deploy -r="main" -d="status"