confirm and deploy prod #78
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: 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 |