forked from LuisEnMarroquin/json-as-xlsx
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (43 loc) · 1.54 KB
/
main.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
name: Prod deploy
on:
push:
branches:
- main
jobs:
deploy:
if: github.repository == 'Kritskii-A/export-json-as-xlsx'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn
- run: yarn test
- run: yarn build
- name: Copy files to library output folder
run: |
cp README.md packages/main-library/README.md
cp LICENSE packages/main-library/LICENSE
- name: Set environment variable for GitHub
run: |
echo "CURRENT_VERSION=$(node -e "console.log('v' + require('./package.json').version)")" >> $GITHUB_ENV
echo CURRENT_VERSION ${{ env.CURRENT_VERSION }}
working-directory: packages/main-library/
- name: Publish package to NPM registry
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" > ~/.npmrc
npm publish --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.TOKEN_NPM }}
working-directory: packages/main-library/
- name: Create a new GitHub release
run: |
echo ${{ secrets.TOKEN_GITHUB }} > nothing.md
gh auth login --with-token < nothing.md
gh release create ${{ env.CURRENT_VERSION }} -F README.md -t "Released ${{ env.CURRENT_VERSION }}"
- name: Prepare static files for deployment
run: yarn run static
- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
branch: gh-pages
git-config-name: AleksandrKritskii
git-config-email: kritskii-a@bk.ru