-
Notifications
You must be signed in to change notification settings - Fork 8
53 lines (51 loc) · 1.97 KB
/
deploy-static-pages.yaml
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
name: Deploy static pages to prod
on:
push:
branches: [main]
workflow_dispatch:
jobs:
deploy-prod:
if: github.repository_owner == 'ParkingReformNetwork'
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Generate data set
run: npm run gen-data-set
- name: Copy data set zip to server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.PRN_FTP_HOST }}
username: ${{ secrets.PRN_SERVER_USERNAME }}
key: ${{ secrets.PRN_SERVER_PRIVATE_KEY }}
source: data/generated/mandates-map-data.zip
target: /var/www/${{ secrets.PRN_SERVER_HOST }}/mandates-map/mandates-map-data.zip
- name: Generate HTML pages
run: npm run gen-html
- name: Archive city_detail/ contents
run: |
cd city_detail
tar -czf ../city_details.tar.gz .
- name: Copy city_detail/ to server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.PRN_FTP_HOST }}
username: ${{ secrets.PRN_SERVER_USERNAME }}
key: ${{ secrets.PRN_SERVER_PRIVATE_KEY }}
source: city_details.tar.gz
target: /var/www/${{ secrets.PRN_SERVER_HOST }}/mandates-map/city_detail
- name: Extract city_detail/ on server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PRN_FTP_HOST }}
username: ${{ secrets.PRN_SERVER_USERNAME }}
key: ${{ secrets.PRN_SERVER_PRIVATE_KEY }}
script: |
tar -xzf /var/www/${{ secrets.PRN_SERVER_HOST }}/mandates-map/city_detail/city_details.tar.gz -C /var/www/${{ secrets.PRN_SERVER_HOST }}/mandates-map/city_detail
rm /var/www/${{ secrets.PRN_SERVER_HOST }}/mandates-map/city_detail/city_details.tar.gz