Allow manual redeploys #132
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 | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
env: | |
REACT_APP_MAP_BOX_ACCESS_TOKEN: ${{ vars.REACT_APP_MAP_BOX_ACCESS_TOKEN }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
strategy: | |
matrix: | |
node-version: [19.x] | |
steps: | |
- name: Fix node space-size | |
run: export NODE_OPTIONS="--max_old_space_size=4096" | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Setup environment | |
run: npm ci | |
- name: Run linters | |
run: npm run lint | |
- name: Run tests | |
run: npm run test | |
- name: Project Build | |
id: build | |
run: | | |
export NODE_OPTIONS="--max_old_space_size=4096" | |
npm run build --if-present | |
working-directory: ${{ env.BUILD_PATH }} | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: ./build | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |