-
Notifications
You must be signed in to change notification settings - Fork 13
80 lines (79 loc) · 2.72 KB
/
publish-patch.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Publish Patch (patch-*)
on:
push:
branches:
- 'patch-*'
jobs:
build:
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup
uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
check-latest: true
- name: Check Node version
run: node -v
- name: Update NPM version
run: npm install -g "npm@^7.6.3"
- name: Install
run: npm ci
- name: Test
run: npm test
- name: Configure NPM
run: |
git config --global user.name 'github-bot'
git config --global user.email '[email protected]'
echo //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} > .npmrc
- name: Publish
run: |
npm run version:exit
npm run version:pkgs
git commit -am "chore: exit prerelease mode"
npm run release
git push --follow-tags
- name: Get Alias
id: info
run: |
echo "::set-output name=alias::$(npm run --silent getAlias)"
echo "::set-output name=version::$(npm run --silent getVersion)"
- name: Build Docs
run: npm run build:docs
env:
PATH_PREFIX: /version/${{ steps.info.outputs.version }}
- name: Deploy Docs to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: './website/react-magma-docs/public'
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: 'Deploy from GitHub Actions'
enable-pull-request-comment: true
enable-commit-comment: true
overwrites-pull-request-comment: true
alias: ${{ steps.info.outputs.alias }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
- name: Build Landing Page
run: npm run build:landing
- name: Update landing page on Netlify
uses: nwtgck/[email protected]
with:
publish-dir: './website/react-magma-landing/dist'
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: 'Deploy Landing page from GitHub Actions'
enable-pull-request-comment: true
enable-commit-comment: true
overwrites-pull-request-comment: true
production-deploy: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
- name: Sync patch-* -> dev-patch
uses: tukasz/direct-merge-action@master
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
source-branch: 'patch-*'
target-branch: dev-patch