Deploy to GitHub Examples #162
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 github pages | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Sleep | |
run: sleep 20s | |
- name: Build | |
run: | | |
npm install | |
npm run build | |
mkdir -p _site | |
cp -r open-works _site/ | |
cp -r dist/* _site/ | |
cp -r test-report _site/ | |
touch _site/.nojekyll | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{steps.deployment.outputs.page_url}} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |