-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Build and publish apps/maps | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'apps/maps/**' | ||
pull_request: | ||
paths: | ||
- 'apps/maps/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-apps-maps: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v1 | ||
- uses: actions/setup-node@v3 | ||
- run: | | ||
npm install | ||
npm run build | ||
working-directory: apps/maps | ||
# Production | ||
- name: Deploy apps/maps production to Netlify | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
run: | | ||
npm install -g netlify-cli | ||
netlify deploy --site=maps-calitp-org --dir=apps/maps/build --prod | ||
env: | ||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | ||
|
||
# Preview on PRs | ||
- name: Deploy apps/maps preview to Netlify | ||
if: ${{ github.ref != 'refs/heads/main' }} | ||
run: | | ||
npm install -g netlify-cli | ||
netlify deploy --site=maps-calitp-org --dir=apps/maps/build --alias=maps-${GITHUB_REPOSITORY#*/}-${PR_NUMBER} | ||
env: | ||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | ||
PR_NUMBER: ${{ github.event.number }} | ||
|
||
- uses: peter-evans/find-comment@v2 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
id: fc | ||
with: | ||
issue-number: ${{ github.event.number }} | ||
comment-author: 'github-actions[bot]' | ||
body-includes: --maps-calitp-org.netlify.app | ||
|
||
- uses: peter-evans/create-or-update-comment@v2 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
with: | ||
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
issue-number: ${{ github.event.number }} | ||
body: "Preview url: https://maps-${{github.event.repository.name}}-${{ github.event.number }}--maps-calitp-org.netlify.app" | ||
edit-mode: replace |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,3 +143,6 @@ dmypy.json | |
|
||
#.DS_Store files that Macs create | ||
.DS_Store | ||
|
||
# Local Netlify folder | ||
.netlify |