From 178501233fd12e26840efba3e37fb2ec209314e7 Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Sun, 19 Feb 2023 13:39:16 +0100 Subject: [PATCH] feat: deploy to pages --- .github/actions/build/action.yaml | 19 ++++++++++++++++++ .github/workflows/preview.yaml | 33 +++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .github/actions/build/action.yaml create mode 100644 .github/workflows/preview.yaml diff --git a/.github/actions/build/action.yaml b/.github/actions/build/action.yaml new file mode 100644 index 0000000..b6b18a5 --- /dev/null +++ b/.github/actions/build/action.yaml @@ -0,0 +1,19 @@ +name: "Build" +description: "Install deps and build docs" + +runs: + using: "composite" + steps: + - uses: pnpm/action-setup@v2 + with: + version: 7 + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: "pnpm" + - name: Install dependencies + run: pnpm install --frozen-lockfile + shell: bash + - name: Build + run: pnpm build + shell: bash diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml new file mode 100644 index 0000000..0b46bb4 --- /dev/null +++ b/.github/workflows/preview.yaml @@ -0,0 +1,33 @@ +name: Docs + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/build + + - uses: actions/configure-pages@v3 + - uses: actions/upload-pages-artifact@v1 + with: + path: "./build" + - id: deployment + uses: actions/deploy-pages@v1