-
Notifications
You must be signed in to change notification settings - Fork 7
217 lines (186 loc) · 7.56 KB
/
Copy pathauto.yml
File metadata and controls
217 lines (186 loc) · 7.56 KB
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
name: Build and Deploy
on:
push:
branches: [main]
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: TruffleHog OSS
uses: trufflesecurity/trufflehog@main
with:
path: ./
base: ${{ github.ref }}
- uses: actions/setup-node@v3
with:
node-version: "16"
- name: SSH Setup
uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.PRIVATE_DEPENDENCY }}
- name: Clone publicgoods-website-test
run: git clone git@github.com:DPGAlliance/DPGAlliance.github.io.git ../publicgoods-website-test
- name: Run static.bash
run: bash scripts/static.bash
# - name: Generating DPG's
# run: cd packages/automation && npm install && node generate_dpgs.js
# - name: Generating Nominees
# env:
# CLIENTID: ${{ secrets.CLIENTID}}
# CLIENTSECRET: ${{ secrets.CLIENTSECRET}}
# run: cd packages/automation && node generate_nominees.js
# - name: Downloading nominees.json file into packages/registry/src
# run: curl --location --request GET 'https://api.digitalpublicgoods.net/nominees/' -o packages/registry/src/nominees.json
- name: Run npm i at root for needed react-scripts package below
run: npm install
- name: Consolidating DPG's and nominees from new API for registry page table
run: cd packages/automation && node consolidate_data.js
- name: Generating registry, eligibility and map pages
run: cd packages/automation && node index.js
- name: Softlink required dependencies
run: |
ln -s ../../../../publicgoods-website-test/wp-includes/ packages/eligibility/public/wp-includes;
ln -s ../../../../publicgoods-website-test/wp-content/ packages/eligibility/public/wp-content;
ln -s ../../../../publicgoods-website-test/wp-includes/ packages/registry/public/wp-includes;
ln -s ../../../../publicgoods-website-test/wp-content/ packages/registry/public/wp-content;
ln -s ../../../../publicgoods-website-test/wp-includes/ packages/map/public/wp-includes;
ln -s ../../../../publicgoods-website-test/wp-content/ packages/map/public/wp-content;
ln -s ../../../../publicgoods-website-test/wp-includes/ packages/roadmap/public/wp-includes;
ln -s ../../../../publicgoods-website-test/wp-content/ packages/roadmap/public/wp-content;
- name: Build packages/eligibility
run: cd packages/eligibility && npm install && npm run build
- name: Build packages/registry
run: cd packages/registry && npm install && npm run build
#- name: Build packages/map
# run: cd packages/map && npm install && npm run build
# env:
# NEXT_PUBLIC_MAPBOX_TOKEN: ${{ secrets.NEXT_PUBLIC_MAPBOX_TOKEN }}
# NEXT_PUBLIC_SHEET_ID: ${{ secrets.NEXT_PUBLIC_SHEET_ID }}
- name: Build packages/roadmap
run: cd packages/roadmap && npm install && npm run build
- name: run movefiles.bash
run: bash scripts/moveFiles.bash
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: /home/runner/work/publicgoods-scripts/publicgoods-website-test
push_to_artifactory:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: artifacts
path: artifacts${{ github.run_number}}/
- name: Setup JFrog CLI
id: setup_JFrog_CLI
uses: jfrog/setup-jfrog-cli@v3
env:
JF_URL: ${{ secrets.JF_URL }}
JF_USER: ${{secrets.JF_USER}}
JF_PASSWORD: ${{secrets.JF_PASSWORD}}
- name: Upload to Jfrog Artifactory
run: jf rt u "artifacts${{ github.run_number}}/*" dpga-website-artifacts --exclusions=".git/**"
deploy_to_test:
needs: push_to_artifactory
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Configuring commit Author
run: |
git config --global user.email "96251909+dpgabot@users.noreply.github.com"
git config --global user.name "dpgabot"
- name: Setup JFrog CLI
id: setup_JFrog_CLI
uses: jfrog/setup-jfrog-cli@v3
env:
JF_URL: ${{ secrets.JF_URL }}
JF_USER: ${{secrets.JF_USER}}
JF_PASSWORD: ${{secrets.JF_PASSWORD}}
- name: Download Artifacts from Artifactory
run: jf rt dl "dpga-website-artifacts/artifacts${{github.run_number}}/*" artifacts/
- name: Checkout Test Repository
uses: actions/checkout@v2
with:
repository: DPGAlliance/DPGAlliance.github.io
path: "testenv"
token: ${{secrets.GITHUBTOKEN }}
- name: Push to Test Environment
run: |
cp -r artifacts/artifacts${{github.run_number}}/* testenv/
cd testenv
find . -name '*.html' -exec sed -i -e "s,http://dpgwebsite.herokuapp.com,https://dpgalliance.github.io/,g" {} \;
touch .nojekyll
git remote set-url origin https://github.com/DPGAlliance/DPGAlliance.github.io.git
git add .
git commit -am "BLD: $GITHUB_SHA" || true
git push --set-upstream origin main
run_tests:
needs: deploy_to_test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Test with Maven
run: |
cd TestAutomation/DPGAUIAutomation
mvn -B package --file pom.xml test
deploy_to_prod:
needs: run_tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Configuring commit Author
run: |
git config --global user.email "96251909+dpgabot@users.noreply.github.com"
git config --global user.name "dpgabot"
- name: Setup JFrog CLI
id: setup_JFrog_CLI
uses: jfrog/setup-jfrog-cli@v3
env:
JF_URL: ${{ secrets.JF_URL }}
JF_USER: ${{secrets.JF_USER}}
JF_PASSWORD: ${{secrets.JF_PASSWORD}}
- name: Download Artifacts from Artifactory
run: jf rt dl "dpga-website-artifacts/artifacts${{github.run_number}}/*" artifacts/
- name: Checkout Prod Repository
uses: actions/checkout@v2
with:
repository: DPGAlliance/publicgoods-website
path: "prodenv"
token: ${{secrets.GITHUBTOKEN }}
- name: Push to Production Environment
run: |
cp -r artifacts/artifacts${{github.run_number}}/* prodenv/
cd prodenv
find . -name '*.html' -exec sed -i -e "s,http://dpgwebsite.herokuapp.com,https://digitalpublicgoods.net,g" {} \;
touch .nojekyll
git remote set-url origin https://github.com/DPGAlliance/publicgoods-website.git
git add .
git commit -am "BLD: $GITHUB_SHA" || true
git push --set-upstream origin main
artifactory_cleanup:
runs-on: ubuntu-latest
steps:
- name: Setup JFrog CLI
id: setup_JFrog_CLI
uses: jfrog/setup-jfrog-cli@v3
env:
JF_URL: ${{ secrets.JF_URL }}
JF_USER: ${{secrets.JF_USER}}
JF_PASSWORD: ${{secrets.JF_PASSWORD}}
- name: Install cleanup plugin
run: jf plugin install rt-cleanup
- name: Run cleanup
run: jf rt-cleanup clean dpga-website-artifacts --time-unit=day --no-dl=14