Skip to content

Commit

Permalink
ci: pr preview
Browse files Browse the repository at this point in the history
  • Loading branch information
trivoallan committed Oct 6, 2024
1 parent b464101 commit 1385acd
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy PR previews

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed

concurrency: preview-${{ github.ref }}

jobs:
deploy-preview:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install and Build
if: github.event.action != 'closed' # You might want to skip the build if the PR has been closed
run: |
yarn install
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./public
preview-branch: main
10 changes: 5 additions & 5 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
workflow_dispatch: ~

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
Expand All @@ -18,7 +18,7 @@ permissions:
# 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"
group: pages
cancel-in-progress: false

jobs:
Expand All @@ -34,15 +34,15 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache: yarn
- run: yarn install
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './public'
path: ./public
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 0 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# yarn lockfile v1


0 comments on commit 1385acd

Please sign in to comment.