From c7f6b2ceb4363e97a07f5441052eab2c92b006da Mon Sep 17 00:00:00 2001 From: Maciej Ziarkowski Date: Mon, 18 Nov 2024 15:23:38 +0100 Subject: [PATCH] Add github pages deployment --- .github/workflows/deploy.yaml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 00000000..4b461ba3 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,48 @@ +name: Publish to GitHub Pages +on: + push: + branches: + - main + workflow_dispatch: # Allows you to run the workflow manually + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + with: + bun-version-file: '.bun-version' + - run: bun install + - name: Build with repository name as base path + env: + PUBLIC_ENV__BASE_URL: /${{ github.event.repository.name }} + run: bun run build -- --base /${{ github.event.repository.name }} + - name: Configure Pages (if this fails, set Pages source to GitHub Actions in repo settings) + uses: actions/configure-pages@v5 + - name: Upload pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./dist/client + + deploy: + needs: build + runs-on: ubuntu-latest + + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # To deploy to Pages + id-token: write # To verify the deployment originates from an appropriate source + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + # Allow one concurrent deployment + concurrency: + group: ${{ github.workflow }}-deploy + + steps: + - name: Deploy pages artifact + uses: actions/deploy-pages@v4 + id: deployment