From 86328a31edb882b6177d866b02a1c647749e103d Mon Sep 17 00:00:00 2001 From: Braulio Rivas Abad <61257604+brauliorivas@users.noreply.github.com> Date: Wed, 15 May 2024 09:06:27 -0500 Subject: [PATCH] Automated deploys via workflows (#16) * setup workflow yml for static site * configure possible workflows for dmX * 3 workflows set up for dmX * remove preview when pr not merged + don't force push --- .github/workflows/development.yml | 22 ++++++++++++++++++++++ .github/workflows/preview.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/static.yml | 23 +++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 .github/workflows/development.yml create mode 100644 .github/workflows/preview.yml create mode 100644 .github/workflows/static.yml diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml new file mode 100644 index 00000000..462db31a --- /dev/null +++ b/.github/workflows/development.yml @@ -0,0 +1,22 @@ +name: Release version of dmX in GitHub Pages +on: + push: + branches: [release] + +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/ + main/ + target-folder: release/ diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 00000000..9e77499d --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,30 @@ +name: Deploy PR previews to GitHub Pages +concurrency: preview-${{ github.ref }} +on: + pull_request: + types: + - opened + - reopened + - synchronize + - closed +permissions: + contents: write +jobs: + deploy-preview: + runs-on: ubuntu-latest + 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 new file mode 100644 index 00000000..f838e0f0 --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,23 @@ +name: Deploy dmX to GitHub Pages +on: + push: + branches: [main] + +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/ + beta/ + target-folder: main/ + force: false