Skip to content

Commit

Permalink
Merge pull request #286 from cal-itp/fix-workflow-dispatch
Browse files Browse the repository at this point in the history
refine workflow_dispatch conditionals
  • Loading branch information
edasmalchi authored Oct 5, 2023
2 parents 4156582 + 8616ea2 commit 4a179c7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ jobs:

# Run data ----
- name: Run report data
if: ${{ github.ref == 'refs/heads/main' || inputs.site_target == 'dev'}}
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && 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' || inputs.site_target == 'dev'}}
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && 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/') || inputs.site_target == 'prod'}}
if: ${{ (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && 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 @@ -69,14 +69,14 @@ jobs:

# deploy ----
- name: Deploy development to Netlify
if: ${{ github.ref == 'refs/heads/main' || inputs.site_target == 'dev'}}
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && 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/' || inputs.site_target == 'prod') }}
if: ${{ (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && inputs.site_target == 'prod')}}
run: |
npm install netlify-cli
netlify deploy --site=cal-itp-reports --dir=./website/build --prod
Expand Down

0 comments on commit 4a179c7

Please sign in to comment.