From fd3f1a00da402acf30538db7662f8318eba302d7 Mon Sep 17 00:00:00 2001 From: Damian Stasik <920747+damianstasik@users.noreply.github.com> Date: Mon, 18 Sep 2023 19:40:18 +0200 Subject: [PATCH] Prepare main branch for deployments to GH Pages (#87) --- .../workflows/{deploy.yml => deploy-dev.yml} | 4 +- .github/workflows/deploy-prod.yml | 44 +++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) rename .github/workflows/{deploy.yml => deploy-dev.yml} (92%) create mode 100644 .github/workflows/deploy-prod.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy-dev.yml similarity index 92% rename from .github/workflows/deploy.yml rename to .github/workflows/deploy-dev.yml index 1b4b0dcf..6a46a3be 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy-dev.yml @@ -1,4 +1,4 @@ -name: Deploy +name: Deploy to Cloudflare Pages on: push: @@ -20,7 +20,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: "16" + node-version: "18" - name: Install dependencies run: npm ci - name: Build website diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml new file mode 100644 index 00000000..ff75a04c --- /dev/null +++ b/.github/workflows/deploy-prod.yml @@ -0,0 +1,44 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - main + + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: "18" + - name: Install dependencies + run: npm ci + - name: Build website + run: npm run build + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: "./build" + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2