From 183ffca45d738a521f46ba302f3925356758b04b Mon Sep 17 00:00:00 2001 From: Huang Tang Date: Sat, 6 Jan 2024 06:36:23 -0500 Subject: [PATCH] Update build-test-deploy.yml --- .github/workflows/build-test-deploy.yml | 50 +++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test-deploy.yml b/.github/workflows/build-test-deploy.yml index 2696f96..9884cda 100644 --- a/.github/workflows/build-test-deploy.yml +++ b/.github/workflows/build-test-deploy.yml @@ -1,10 +1,10 @@ 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 @@ -12,3 +12,47 @@ jobs: 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