Skip to content

Commit

Permalink
Update build-test-deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tangchaous authored Jan 6, 2024
1 parent a63042f commit 183ffca
Showing 1 changed file with 47 additions and 3 deletions.
50 changes: 47 additions & 3 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,58 @@
name: build-test-deploy
on: push
jobs:
build-using-npm:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
- 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
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:
needs: test
permissions:
contents: write
pages: write
id-token: write
environment:
name: production
url: ${{ steps.deployment.outputs.page_url }}
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'
- name: configure github pages
uses: actions/configure-pages@v3
with:
static_site_generator: next
- run: npm install
- run: npm run build
- name: upload artifacts
uses: actions/upload-pages-artifact@v1
with:
path: "./out"
- name: deploy
id: deployment
uses: actions/deploy-pages@v1

0 comments on commit 183ffca

Please sign in to comment.