Update build-and-deploy.yml #22
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: build_and_deploy | |
on: | |
push: | |
branches: | |
- 'main' | |
paths-ignore: | |
- '**/README.md' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v3 | |
- name: clean workspace | |
run: rm -rf node_modules && npm cache clean --force | |
- name: install dependencies | |
run: npm ci | |
- name: build the project | |
run: npm run docker-prod | |
- name: verify build output | |
run: ls -l build | |
- name: upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build | |
path: build | |
deploy: | |
# Add a dependency to the build job | |
needs: build | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
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 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |