This repository was archived by the owner on Jan 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
69 lines (61 loc) · 2.37 KB
/
deploy.yml
File metadata and controls
69 lines (61 loc) · 2.37 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Publish and Deploy
# only deploy site from master branch
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
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: actions/setup-node@v3
with:
node-version: 16
- name: Check version changes
uses: EndBug/version-check@v1
id: check
with:
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 }})"'
- uses: bahmutov/npm-install@v1
if: steps.check.outputs.changed == 'true'
with:
install-command: yarn --ignore-optional
- uses: bahmutov/npm-install@v1
if: steps.check.outputs.changed == 'true'
with:
working-directory: addons/AutoAnnotate
- run: npm run buildWithDemo
if: steps.check.outputs.changed == 'true'
- uses: JS-DevTools/npm-publish@v1
if: steps.check.outputs.changed == 'true'
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Update Changelog
run: npm run changelog
if: steps.check.outputs.changed == 'true'
- name: get-npm-version
if: steps.check.outputs.changed == 'true'
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- name: Deploy Version 🚀
if: steps.check.outputs.changed == 'true'
uses: JamesIves/github-pages-deploy-action@v4.2.2
with:
branch: gh-pages # The branch the action should deploy to.
folder: ./demo/dist # The folder the action should deploy.
target-folder: version/${{steps.package-version.outputs.current-version}}
- name: Deploy Main App 🚀
if: steps.check.outputs.changed == 'true'
uses: JamesIves/github-pages-deploy-action@v4.2.2
with:
branch: gh-pages # The branch the action should deploy to.
folder: ./demo/dist # The folder the action should deploy.
clean: true # Automatically remove deleted files from the deploy branch
clean-exclude: version