Skip to content

Commit

Permalink
fix: deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman035 committed Nov 21, 2024
1 parent 592ab87 commit b4b9d3c
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ jobs:
deploy:
runs-on: ubuntu-latest

strategy:
matrix:
app:
- email
- core-connection

steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -25,28 +19,32 @@ jobs:
node-version: 20
cache: 'npm'

- name: Install dependencies and build
run: |
cd examples/${{ matrix.app }}
npm install
npm run build
mkdir -p ../../gh-pages/${{ matrix.app }}
cp -R dist/* ../../gh-pages/${{ matrix.app }}
- name: Prepare gh-pages directory
run: mkdir -p gh-pages

- name: Checkout existing gh-pages
- name: Checkout existing gh-pages branch
uses: actions/checkout@v3
with:
ref: gh-pages
path: gh-pages-existing
path: gh-pages

- name: Build Email App
run: |
cd examples/email
npm install
npm run build
mkdir -p ../../gh-pages/email
cp -R dist/* ../../gh-pages/email
- name: Merge new builds with existing
- name: Build Core Connection App
run: |
cp -R gh-pages-existing/* gh-pages || true
cp -R gh-pages/* gh-pages-existing
mv gh-pages-existing gh-pages
cd examples/core-connection
npm install
npm run build
mkdir -p ../../gh-pages/core-connection
cp -R dist/* ../../gh-pages/core-connection
- name: Deploy to GitHub Pages
if: ${{ matrix.app == 'core-connection' }} # Deploy after the last app
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit b4b9d3c

Please sign in to comment.