-
Notifications
You must be signed in to change notification settings - Fork 2
37 lines (35 loc) · 1.31 KB
/
confirm_and_deploy_prod.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
name: confirm and deploy prod
on:
deployment_status:
environment: NEW_ER_CLOUD
jobs:
deploy_production:
concurrency:
group: confirm_deploy_eb_app
cancel-in-progress: true
runs-on: self-hosted
environment: EB_PROD
if: github.event.deployment_status.state == 'success' && github.event.deployment_status.environment == 'NEW_ER_CLOUD'
env:
BACKUP: \\${{vars.WEB_HOST}}\R9apps\apps\COP_backup
LATEST: \\${{vars.WEB_HOST}}\R9apps\apps\COP_LATEST
PROD: \\${{vars.WEB_HOST}}\R9apps\apps\cop
steps:
- name: remove backup and latest folders if exists
run: |
if (Test-Path $env:BACKUP) {
Remove-Item -Recurse -Force $env:BACKUP
}
if (Test-Path $env:LATEST) {
Remove-Item -Recurse -Force $env:LATEST
}
if (Test-Path ${{ github.workspace }}\exp_builder_widgets_export.zip) {
Remove-Item -Force ${{ github.workspace }}\exp_builder_widgets_export.zip
}
- name: move staging to prod latest
run: |
Copy-Item -Path \\${{vars.WEB_HOST}}\R9Apps\staging\COP -Destination $env:LATEST -Recurse -Force
- name: backup prod and deploy latest to prod
run: |
Rename-Item $env:PROD $env:BACKUP
Rename-Item $env:LATEST $env:PROD