Skip to content

Commit

Permalink
Merge pull request #279 from cal-itp/aug-reports
Browse files Browse the repository at this point in the history
Aug reports
  • Loading branch information
edasmalchi authored Sep 12, 2023
2 parents 4a403be + 7979894 commit 6860ee9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# repo owners

* @edasmalchi @charlie-costanzo @atvaccaro
* @edasmalchi @owades
20 changes: 15 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
name: Build and deploy to Netlify

on:
workflow_dispatch:
inputs:
site_target:
description: 'Deploy to development or production Reports site? (must deploy to development first)'
required: true
default: 'dev'
type: choice
options:
- dev
- prod
push:
tags:
- '*'
Expand Down Expand Up @@ -35,19 +45,19 @@ jobs:

# Run data ----
- name: Run report data
if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ github.ref == 'refs/heads/main' || inputs.site_target == 'dev'}}
working-directory: reports
run: |
make parameters
make data
# copy data ----
- name: Copy development report data
if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ github.ref == 'refs/heads/main' || inputs.site_target == 'dev'}}
run: |
gsutil -m rsync -r reports/outputs/ gs://test-calitp-reports-data/report_gtfs_schedule/
- name: Copy production report data
if: ${{ startsWith(github.ref, 'refs/tags/') }}
if: ${{ startsWith(github.ref, 'refs/tags/') || inputs.site_target == 'prod'}}
run: |
gsutil -m rsync -r gs://test-calitp-reports-data/report_gtfs_schedule/ gs://calitp-reports-data/report_gtfs_schedule/
gsutil -m rsync -r gs://calitp-reports-data/report_gtfs_schedule/ reports/outputs/
Expand All @@ -59,14 +69,14 @@ jobs:

# deploy ----
- name: Deploy development to Netlify
if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ github.ref == 'refs/heads/main' || inputs.site_target == 'dev'}}
run: |
npm install netlify-cli
netlify deploy --site=cal-itp-reports --dir=./website/build --alias=test
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
- name: Deploy production to Netlify
if: ${{ startsWith(github.ref, 'refs/tags/') }}
if: ${{ startsWith(github.ref, 'refs/tags/' || inputs.site_target == 'prod') }}
run: |
npm install netlify-cli
netlify deploy --site=cal-itp-reports --dir=./website/build --prod
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,6 @@ Once you've synced data to either development or production, you may deploy the
appropriate environment to Netlify.
* For development, pushing a commit (or merging a PR) to the `main` branch
* For production, pushing a tag
* Alternatively, manually start the workflow and select development or production

You may want to monitor GitHub Actions to ensure your deploy succeeded.

0 comments on commit 6860ee9

Please sign in to comment.