From 9efd95dd57ba993ab30d182c51221ddc5702d5e3 Mon Sep 17 00:00:00 2001 From: Tiago Ruas Date: Sat, 20 Apr 2024 18:39:16 +0200 Subject: [PATCH] Simplify build and deploy --- .github/workflows/build-and-deploy.yml | 45 +++++++++++++++++++------- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 3c1b61c..aac1bfe 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -1,23 +1,44 @@ -name: Build and Deploy +name: Build and deploy to GitHub Pages + on: push: - branches: - - master + branches: ["master"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + jobs: build-and-deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - - name: Checkout 🛎️ - uses: actions/checkout@v2.3.1 - - - name: Install and Build 🔧 + - name: Checkout + uses: actions/checkout@v4 + - name: Install and build run: | yarn install yarn run build touch build/.nojekyll - - - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@4.1.1 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: - branch: gh-pages - folder: build + path: "build" + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4