This repository has been archived by the owner on Dec 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
47 lines (41 loc) · 1.88 KB
/
web_build.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
name: 'Web Build and Deploy'
on:
schedule:
- cron: '10 * * * *'
workflow_dispatch:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.3.1
with:
persist-credentials: false
- name: Download JSON files to assets folder
run: |
wget --quiet -O web/src/assets/DayConfirmationAgeCountyGender19CoV.json https://github.com/peter279k/covid19-tw-news/raw/master/datasets/DayConfirmationAgeCountyGender19CoV.json
wget --quiet -O web/src/assets/covid19_data.json https://github.com/peter279k/covid19-tw-news/raw/master/datasets/covid19_data.json
wget --quiet -O web/src/assets/covid19_global_cases_and_deaths.json https://github.com/peter279k/covid19-tw-news/raw/master/datasets/covid19_global_cases_and_deaths.json
wget --quiet -O web/src/assets/covid19_labs.json https://github.com/peter279k/covid19-tw-news/raw/master/datasets/covid19_labs.json
wget --quiet -O web/src/assets/mohw_rss.json https://github.com/peter279k/covid19-tw-news/raw/master/datasets/mohw_rss.json
- name: Install and Build 🔧
working-directory: web
run: |
cp .env.example .env
export NODE_OPTIONS="--max-old-space-size=8192"
export VUE_APP_MAPKEY=${{ secrets.VUE_APP_MAPKEY }}
sed -i -e "s/MAP_KEY/$VUE_APP_MAPKEY/g" ./.env
npm install
npm run build
cd dist
cp index.html 404.html
- name: Install the SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: Deploy to remote server via rsync 🚀
run: rsync -avz ./web/dist/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/var/www/covid19-tw-news.peterli.website/dist