Skip to content

Commit

Permalink
Automated deploys via workflows (#16)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
brauliorivas authored May 15, 2024
1 parent e786c89 commit 86328a3
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
@@ -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/
30 changes: 30 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 86328a3

Please sign in to comment.