Skip to content

Commit

Permalink
Specify default settings that will apply to all jobs in the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
esme committed Apr 4, 2023
1 parent 2f534ee commit 0504eb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
push:
branches: [project-demo-v1]

defaults:
run:
working-directory: demos

jobs:
build-and-deploy:
runs-on: ubuntu-latest
Expand All @@ -13,11 +17,11 @@ jobs:
uses: actions/checkout@v3
- name: Install and build 🔧
run: npm run predeploy
working-directory: demos
- name: Run tests ✅
run: npm run test
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
branch: gh-pages
clean-exclude: pr-preview
working-directory: demos
7 changes: 4 additions & 3 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: ['*demo*']

defaults:
run:
working-directory: demos

jobs:
deploy-preview:
runs-on: ubuntu-latest
Expand All @@ -14,15 +18,12 @@ jobs:
uses: actions/checkout@v3
- name: Install and build 🔧
run: npm run predeploy
working-directory: demos
- name: Run tests ✅
run: npm run test
working-directory: demos
- name: Deploy preview 🚀
uses: rossjrw/pr-preview-action@v1.3.0
with:
source-dir: ./build
preview-branch: gh-pages
umbrella-dir: pr-preview
action: auto
working-directory: demos

0 comments on commit 0504eb0

Please sign in to comment.