-
Notifications
You must be signed in to change notification settings - Fork 20
48 lines (47 loc) · 2.05 KB
/
update_gh_pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Update gh-pages
on: [push]
jobs:
update-gh-pages:
strategy:
matrix:
package_name: [ove, ui]
name: Update gh-pages
runs-on: ubuntu-20.04
if: contains(github.ref, 'master') # Publish it only if the push comes from the master branch
steps:
# https://github.com/actions/checkout
- name: Checkout 🛎️
uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Check version changes
uses: EndBug/version-check@v2 # You can choose the version/branch you prefer.
id: check
with:
file-name: ./packages/${{ matrix.package_name }}/package.json
diff-search: true
- name: Version update detected
if: steps.check.outputs.changed == 'true'
run: 'echo "Version change found! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'
- name: Install Dependencies
if: steps.check.outputs.changed == 'true'
run: bun install --frozen-lockfile
- run: bun nx run ${{ matrix.package_name }}:build --configuration=demo
if: steps.check.outputs.changed == 'true'
- name: Deploy Version 🚀
if: steps.check.outputs.changed == 'true'
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: ./demo-dist/${{ matrix.package_name }} # The folder the action should deploy.
target-folder: ${{ matrix.package_name }}/version/${{steps.check.outputs.version}}
- name: Deploy Main App 🚀
if: steps.check.outputs.changed == 'true'
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: ./demo-dist/${{ matrix.package_name }} # The folder the action should deploy.
target-folder: ${{ matrix.package_name }}/
clean: true # Automatically remove deleted files from the deploy branch
clean-exclude: version