diff --git a/.github/workflows/build-and-deploy-to-ghpages.yaml b/.github/workflows/build-and-deploy-to-ghpages.yaml new file mode 100644 index 0000000..5329889 --- /dev/null +++ b/.github/workflows/build-and-deploy-to-ghpages.yaml @@ -0,0 +1,55 @@ +name: Build and Deploy to GitHub Pages + +on: + push: + branches: ["main"] + pull_request: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20.x] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + if: github.event_name != 'pull_request' + uses: actions/configure-pages@v5 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run build -- --base-href /loyolaorsino/ + - run: npm run test + - name: Upload artifact + if: github.event_name != 'pull_request' + uses: actions/upload-pages-artifact@v3 + with: + path: './dist/loyolaorsino' + + deploy: + if: github.event_name != 'pull_request' + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4