-
Notifications
You must be signed in to change notification settings - Fork 3
144 lines (118 loc) · 4.08 KB
/
prod-deploy.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: 'Homepage orcid.org Deploy'
run-name: 'orcid.org deploy version ${{ inputs.version }} to ${{ inputs.environment }} by @${{ github.actor }}'
on:
workflow_dispatch:
inputs:
version:
type: string
description: 'Tag version to deploy'
required: true
default: 'v0.1.0'
jobs:
upload_prod_wordpress_to_qa_s3:
environment: qa.orcid.org
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests beautifulsoup4 urllib3
- name: Checkout repository
uses: actions/checkout@v3
- name: Switch to specific tag
run: |
git fetch --tags
git checkout ${{ github.event.inputs.version }}
- name: Upload HTML to S3
uses: reggionick/s3-deploy@v4
with:
folder: dist
bucket: ${{secrets.QA_AWS_BUCKET}}
bucket-region: ${{ secrets.AWS_REGION }}
delete-removed: true
no-cache: true
private: true
files-to-include: '{.*/**,**}'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1'
- name: Validate QA Deployment
run: |
python wordpress-prod-release-validation.py QA ${{ github.event.inputs.version }}
upload_prod_wordpress_to_fallback_s3:
runs-on: ubuntu-latest
environment: orcid.org
needs: upload_prod_wordpress_to_qa_s3
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests beautifulsoup4 urllib3
- name: Checkout repository
uses: actions/checkout@v3
- name: Switch to specific tag
run: |
git fetch --tags
git checkout ${{ github.event.inputs.version }}
- name: Upload HTML to S3
uses: reggionick/s3-deploy@v4
with:
folder: dist
bucket: ${{ secrets.FALLBACK_AWS_BUCKET }}
bucket-region: ${{ secrets.AWS_REGION }}
delete-removed: true
no-cache: true
private: true
files-to-include: '{.*/**,**}'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1'
- name: Validate Fallback Deployment
run: |
python wordpress-prod-release-validation.py FALLBACK ${{ github.event.inputs.version }}
upload_prod_wordpress_to_prod_s3:
runs-on: ubuntu-latest
environment: orcid.org
needs: upload_prod_wordpress_to_fallback_s3
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests beautifulsoup4 urllib3
- name: Checkout repository
uses: actions/checkout@v3
- name: Switch to specific tag
run: |
git fetch --tags
git checkout ${{ github.event.inputs.version }}
- name: Upload HTML to S3
uses: reggionick/s3-deploy@v4
with:
folder: dist
bucket: ${{ secrets.PROD_AWS_BUCKET }}
bucket-region: ${{ secrets.AWS_REGION }}
delete-removed: true
no-cache: true
private: true
files-to-include: '{.*/**,**}'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1'
- name: Validate Production Deployment
run: |
python wordpress-prod-release-validation.py PROD ${{ github.event.inputs.version }}