Merge pull request #32 from the-hideout/updates #45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
environment: production | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: azure/login@ec3c14589bd3e9312b3cc8c41e6860e258df9010 # 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@4a03da89e5c43da56e502053be4bbcb293411883 # [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" |