-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (55 loc) · 1.97 KB
/
dev_backend_asa_pr.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Dev BE ASA Pull Request
on:
workflow_dispatch:
pull_request:
branches:
- development
paths:
- backend/models/**
- backend/ops_api/**
- backend/Dockerfile.ops-api
env:
TERRAFORM_VERSION: "1.5.7"
TF_IN_AUTOMATION: "True"
ENVIRONMENT: "dev"
WORKING_DIR: "backend"
DOCKER_FILE: "Dockerfile.ops-api"
jobs:
build:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- name: Build and publish the Docker image for ${{ github.repository }}
uses: macbre/push-to-ghcr@0f6c180522d02d9e608096c4dcf3b691193b4d44 #v13
with:
image_name: ${{ github.repository }}/ops-${{ env.WORKING_DIR }} # it will be lowercased internally
github_token: ${{ secrets.GITHUB_TOKEN }}
context: ${{ github.workspace }}/${{ env.WORKING_DIR }}
dockerfile: ${{ github.workspace }}/${{ env.WORKING_DIR }}/${{ env.DOCKER_FILE }}
image_tag: ${{ github.sha }}
plan-deploy:
needs: build
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- name: Terraform Plan
uses: ./.github/actions/tf-plan
with:
terraform_directory: "terraform/eus/${{ env.ENVIRONMENT }}/${{ env.WORKING_DIR }}_asa"
terraform_version: ${{ env.TERRAFORM_VERSION }}
azure_client_id: ${{ secrets.ARM_CLIENT_ID }}
azure_client_secret: ${{ secrets.ARM_CLIENT_SECRET }}
azure_subscription_id: ${{ secrets.ARM_SUBSCRIPTION_ID }}
azure_tenant_id: ${{ secrets.ARM_TENANT_ID }}
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_id: ${{ github.event.pull_request.number }}
tf_vars: |
{
"environment": "${{ env.ENVIRONMENT }}",
"container_tag": "${{ github.sha }}"
}