Skip to content

Commit cad6d7b

Browse files
authored
Merge 9bcaf2c into 01c7559
2 parents 01c7559 + 9bcaf2c commit cad6d7b

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: time-tracker-ui-cd-stage
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
cd:
10+
runs-on: ubuntu-latest
11+
env:
12+
TF_WORKSPACE: stage
13+
WORKING_DIR: infrastructure/
14+
ARM_CLIENT_ID: ${{secrets.TF_ARM_CLIENT_ID}}
15+
ARM_CLIENT_SECRET: ${{secrets.TF_ARM_CLIENT_SECRET}}
16+
ARM_SUBSCRIPTION_ID: ${{secrets.TF_ARM_SUBSCRIPTION_ID}}
17+
ARM_TENANT_ID: ${{secrets.TF_ARM_TENANT_ID}}
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
23+
- name: Get the release_version
24+
run: |
25+
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
26+
echo $RELEASE_VERSION
27+
- name: Login to azure
28+
uses: Azure/login@v1
29+
with:
30+
creds: ${{ secrets.AZURE_CREDENTIALS }}
31+
# old yaml start here
32+
- name: Set up Node.js version
33+
uses: actions/setup-node@v1
34+
with:
35+
node-version: '12.x'
36+
37+
- name: Inject Secrets
38+
env:
39+
SCOPES: ${{ secrets.scopes }}
40+
CLIENT_ID: ${{ secrets.client_id }}
41+
AUTHORITY: ${{ secrets.authority }}
42+
STACK_EXCHANGE_ID: ${{ secrets.stack_exchange_id }}
43+
STACK_EXCHANGE_ACCESS_TOKEN: ${{ secrets.stack_exchange_access_token }}
44+
AZURE_APP_CONFIGURATION_CONNECTION_STRING: ${{ secrets.azure_app_configuration_connection_string }}
45+
run: |
46+
chmod +x ./scripts/populate-keys.sh
47+
sh ./scripts/populate-keys.sh
48+
- name: 'run: npm install and build'
49+
run: |
50+
npm install
51+
npm run build --prod --if-present
52+
cp scripts/default-static-site.js ${BUILD_PATH}
53+
# old yaml stop here
54+
55+
- name: Build the docker image
56+
run: make build
57+
58+
- name: Publish docker image to stage azure container registry
59+
run: |
60+
make login publish acr=timetrackerservicestageregistry docker_image_name=$RELEASE_VERSION
61+
- name: Setup terraform
62+
uses: hashicorp/setup-terraform@v1
63+
64+
- name: Authenticate with the TF modules repository
65+
uses: webfactory/[email protected]
66+
with:
67+
ssh-private-key: ${{ secrets.INFRA_TERRAFORM_MODULES_SSH_PRIV_KEY }}
68+
69+
- name: Terraform Init
70+
working-directory: ${{ env.WORKING_DIR }}
71+
run: terraform init
72+
73+
- name: Terraform Apply
74+
working-directory: ${{ env.WORKING_DIR }}
75+
run: terraform apply -lock=false -var-file="${{ env.TF_WORKSPACE }}.tfvars" -var "docker_image_name=$RELEASE_VERSION" -auto-approve

0 commit comments

Comments
 (0)