Deploy Visualization #139
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Visualization | |
on: | |
push: | |
branches: ["main"] | |
workflow_run: | |
workflows: ["CI"] | |
types: | |
- completed | |
branches: ["main"] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4.2.0 | |
with: | |
python-version: "3.10" | |
- name: Download artifacts | |
id: download-artifact | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: main.yml | |
workflow_conclusion: success | |
name: op_survey_results | |
path: output | |
- name: Download artifacts | |
id: download-artifact-coreml-tools | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: coremltools.yml | |
workflow_conclusion: success | |
name: op_survey_coremltools | |
path: output | |
- name: Display structure of downloaded files | |
run: ls -R | |
working-directory: output | |
- name: Process data for visualization | |
run: | | |
python op_matrix/process_data_for_visualization.py --input_dir output/ --output op-vis/public/data/op_survey.json | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: "npm" | |
cache-dependency-path: "op-vis/package-lock.json" | |
- name: Build react app | |
run: npm ci --legacy-peer-deps | |
working-directory: "op-vis" | |
- run: npm run build | |
working-directory: "op-vis" | |
- name: Display structure of the build folder | |
run: ls -R | |
working-directory: "op-vis/build" | |
# Deploy artifacts to github | |
- name: Setup Pages | |
uses: actions/configure-pages@v2 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
# Upload the build folder | |
path: "op-vis/build" | |
deploy: | |
needs: build | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
# Deploy to the github-pages environment | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |