updates #26
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-test-deploy | |
on: push | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo | |
uses: actions/checkout@v3 | |
- name: use node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- run: npm install | |
- run: npm run build --if-present | |
test: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo | |
uses: actions/checkout@v3 | |
- name: use node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- run: npm install | |
- run: npm test | |
# Deploy job | |
deploy: | |
# Add a dependency to the build job | |
needs: test | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
deployments: write | |
contents: write | |
statuses: write | |
actions: write | |
checks: read | |
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 | |
url: ${{ steps.deployment.outputs.page_url }} | |
# Specify runner + deployment step | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: use node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- run: npm install | |
- run: npm run build --if-present | |
- name: Configure GitHub Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload Artifacts | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: "./pages" | |
- name: Deploy | |
id: deployment | |
uses: actions/deploy-pages@v1 | |
# - name: Deploy 🚀 | |
# uses: JamesIves/github-pages-deploy-action@v4 | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# repository: https://github.com/bekahwhittle/actions-learning-100.git | |
# folder: . # The folder the action should deploy. |