Skip to content

Commit

Permalink
run as separate jobs to fetch data
Browse files Browse the repository at this point in the history
save as artifact, and download later
  • Loading branch information
kirkhansen committed Feb 28, 2021
1 parent 4673780 commit 8c7d5c9
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 5 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,32 @@ on:
branches:
- master
jobs:
deploy:
fetch-data:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v2
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- run: cd backend && pip install -e . && python3 covid_vaccine_finder/main.py
- run: |
cd backend
pip install -e .
python3 covid_vaccine_finder/main.py # Saves *.json files to frontend currently
- name: Save data and last updated
uses: actions/upload-artifact@v2
with:
name: vaccine-info
path: |
frontend/public/*.json
deploy:
needs: fetch-data
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
Expand All @@ -24,6 +38,10 @@ jobs:
run: cd frontend && npm install
- name: Build page
run: cd frontend && npm run build
- name: Download a single artifact
uses: actions/download-artifact@v2
with:
name: vaccine-info
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/fetch-data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Deployment
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v2
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- run: |
cd backend
pip install -e .
python3 covid_vaccine_finder/main.py
- name: Save data and last updated
uses: actions/upload-artifact@v2
with:
name: dist-without-markdown
path: |
frontend/public/*.json
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.swp

0 comments on commit 8c7d5c9

Please sign in to comment.