-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCD-APP.yml
101 lines (92 loc) · 2.83 KB
/
CD-APP.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
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
92
93
94
95
96
97
98
99
100
101
name: CD-WEB-APP
run-name: Deploy App Services to any Environment
# Controls when the workflow will run
on:
workflow_call:
inputs:
project_name:
type: string
required: true
repo_name:
type: string
required: true
runner_name:
type: string
required: true
build_number:
type: string
required: true
publish_profile:
type: string
required: true
environment_name:
type: string
required: true
app_name:
type: string
required: true
env_filename:
type: string
required: true
workflow_dispatch:
# Environment variables available to all jobs and steps in this workflow
env:
PROJECT_NAME: ${{ inputs.project_name }}
REPO_NAME: ${{ inputs.repo_name }}
BUILD_NUMBER: ${{ inputs.build_number }}
PUBLISH_PROFILE: ${{secrets[inputs.publish_profile]}}
ENVIRONMENT_NAME: ${{ inputs.environment_name }}
APP_NAME: ${{inputs.app_name}}
ENV_FILENAME: ${{ inputs.env_filename }}
# A workflow run is made up of one or more jobs
jobs:
push-deploy:
runs-on: ${{ inputs.runner_name }}
environment:
name: ${{ inputs.environment_name }}
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.REPO_NAME }}-${{ env.BUILD_NUMBER }}
- name: Expanding Artifact
run: |
New-Item -Force -ItemType directory -Path ${{ env.REPO_NAME }}
tar -xvf ${{ env.REPO_NAME }}-${{ env.BUILD_NUMBER }}.tar -C ${{ env.REPO_NAME }}
- name: Replace placeholder
run: |
cd ${{ github.workspace }}\${{ env.REPO_NAME }}\
.\.next\standalone\replaceplaceholder.ps1 -placeholderprefix UIPLACEHOLDER_ -valuesenvfile ${{ env.ENV_FILENAME }} -targetfolder .\.next\standalone\
shell: pwsh
- name: 'Deploy to Azure WebApp'
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.APP_NAME }}
publish-profile: ${{ env.PUBLISH_PROFILE }}
package: '.\${{ env.REPO_NAME }}'
update-deployed-version:
needs: [push-deploy]
runs-on: ubuntu-latest
permissions:
actions: write
checks: write
contents: write
deployments: write
id-token: write
issues: write
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: write
security-events: read
statuses: read
steps:
- name: Update the confluence
uses: revenue-solutions-inc/confluence-rsi@v1
with:
service: ${{ env.PROJECT_NAME }}
env: ${{ env.ENVIRONMENT_NAME }}
version: ${{ env.BUILD_NUMBER }}
token: ${{ secrets.CONFLUENCE_TOKEN }}
connectionstring: ${{ secrets.COSMOS_CONNECTION_STRING }}