From d77377d246541b0e0924d89bac574c4250ca3e03 Mon Sep 17 00:00:00 2001 From: Braulio Rivas Abad Date: Wed, 8 May 2024 10:08:24 -0500 Subject: [PATCH 1/5] setup workflow yml for static site --- .github/workflows/preview.yml | 0 .github/workflows/static.yml | 43 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .github/workflows/preview.yml create mode 100644 .github/workflows/static.yml diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 00000000..e69de29b diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 00000000..3ebb50b8 --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,43 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Deploy static content to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # 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: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload entire repository + path: "." + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 From 9c934c36123a5892f7a5f8582fd73c7e07995bcb Mon Sep 17 00:00:00 2001 From: Braulio Rivas Abad Date: Thu, 9 May 2024 21:20:39 -0500 Subject: [PATCH 2/5] configure possible workflows for dmX --- .github/workflows/development.yml | 20 +++++++++++++ .github/workflows/preview.yml | 20 +++++++++++++ .github/workflows/static.yml | 48 +++++++++---------------------- 3 files changed, 53 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/development.yml diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml new file mode 100644 index 00000000..90f50625 --- /dev/null +++ b/.github/workflows/development.yml @@ -0,0 +1,20 @@ +name: Deploy dmX beta to GitHub Pages +on: + push: + branches: [beta] + +permissions: + contents: write +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v3 + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: . + clean-exclude: pr-preview/ + target-folder: beta/ diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index e69de29b..0c5cc030 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -0,0 +1,20 @@ +name: Deploy PR previews to GitHub Pages +concurrency: preview-${{ github.ref }} +on: + pull_request: + types: + - opened + - reopened + - synchronize + - closed +jobs: + deploy-preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: rossjrw/pr-preview-action@v1 + with: + source-dir: . + preview-branch: gh-pages + umbrella-dir: pr-preview + action: auto diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 3ebb50b8..1e126914 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -1,43 +1,21 @@ -# Simple workflow for deploying static content to GitHub Pages -name: Deploy static content to Pages - +name: Deploy dmX to GitHub Pages on: - # Runs on pushes targeting the default branch push: - branches: ["main"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + branches: [main] -# 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 - + contents: write jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} + build-and-deploy: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Pages - uses: actions/configure-pages@v5 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + - name: Checkout 🛎️ + uses: actions/checkout@v3 + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@v4 with: - # Upload entire repository - path: "." - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + folder: . + clean-exclude: | + pr-preview/ + beta/ From 79fdcdf2a1bcfefc703af76b0d00e8bfe6ff448e Mon Sep 17 00:00:00 2001 From: Braulio Rivas Abad Date: Mon, 13 May 2024 14:59:07 -0500 Subject: [PATCH 3/5] 3 workflows set up for dmX --- .github/workflows/development.yml | 14 ++++++++------ .github/workflows/static.yml | 5 +++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index 90f50625..462db31a 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -1,7 +1,7 @@ -name: Deploy dmX beta to GitHub Pages +name: Release version of dmX in GitHub Pages on: push: - branches: [beta] + branches: [release] permissions: contents: write @@ -9,12 +9,14 @@ jobs: build-and-deploy: runs-on: ubuntu-latest steps: - - name: Checkout 🛎️ + - name: Checkout uses: actions/checkout@v3 - - name: Deploy 🚀 + - name: Deploy uses: JamesIves/github-pages-deploy-action@v4 with: folder: . - clean-exclude: pr-preview/ - target-folder: beta/ + clean-exclude: | + pr-preview/ + main/ + target-folder: release/ diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 1e126914..a1bdd882 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -9,13 +9,14 @@ jobs: build-and-deploy: runs-on: ubuntu-latest steps: - - name: Checkout 🛎️ + - name: Checkout uses: actions/checkout@v3 - - name: Deploy 🚀 + - name: Deploy uses: JamesIves/github-pages-deploy-action@v4 with: folder: . clean-exclude: | pr-preview/ beta/ + target-folder: main/ From 52d0d99591468cfa8403ae770726618592035892 Mon Sep 17 00:00:00 2001 From: Braulio Rivas Abad Date: Tue, 14 May 2024 20:03:43 -0500 Subject: [PATCH 4/5] remove preview when pr not merged + don't force push --- .github/workflows/preview.yml | 8 ++++++++ .github/workflows/static.yml | 1 + 2 files changed, 9 insertions(+) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 0c5cc030..ce7152b7 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -13,8 +13,16 @@ jobs: steps: - uses: actions/checkout@v3 - uses: rossjrw/pr-preview-action@v1 + if: contains(['opened', 'reopened', 'synchronize'], ${{ github.event.action }}) with: source-dir: . preview-branch: gh-pages umbrella-dir: pr-preview action: auto + - uses: rossjrw/pr-preview-action@v1 + if: github.event.action == 'closed' && !github.event.pull_request.merged + with: + source-dir: . + preview-branch: gh-pages + umbrella-dir: pr-preview + action: remove diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index a1bdd882..f838e0f0 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -20,3 +20,4 @@ jobs: pr-preview/ beta/ target-folder: main/ + force: false From 0aa41e975b3abd319ddbedeb9acd3e11c85c1087 Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Wed, 15 May 2024 15:49:20 +0200 Subject: [PATCH 5/5] Check if fixing permissions in workflow file fixes things --- .github/workflows/preview.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index ce7152b7..9e77499d 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -7,6 +7,8 @@ on: - reopened - synchronize - closed +permissions: + contents: write jobs: deploy-preview: runs-on: ubuntu-latest