forked from dynamoose/dynamoose
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (65 loc) · 2.18 KB
/
publish.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
name: Publish
on:
release:
types: [published]
jobs:
getinfo:
runs-on: ubuntu-latest
outputs:
npmtag: ${{ steps.data.outputs.npmtag }}
websites3bucket: ${{ steps.data.outputs.websites3bucket }}
steps:
- uses: actions/checkout@v2
- run: npm i
working-directory: ./publish
- run: node publish/information/index.js
id: data
publish-npm:
needs:
- getinfo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: lts/*
registry-url: https://registry.npmjs.org/
- run: npm install
- run: node publish/copy-readme.js
- run: lerna publish from-package --dist-tag $TAG --yes --no-git-tag-version --no-push --no-verify-access --no-git-reset
env:
TAG: ${{ needs.getinfo.outputs.npmtag }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
publishsite:
needs: getinfo
runs-on: ubuntu-latest
if: needs.getinfo.outputs.websites3bucket != ''
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: lts/*
- run: npm install
- run: npm run site:install
- run: npm run site:crowdin:sync
env:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
- run: npm run site:build
- uses: jakejarvis/[email protected]
with:
args: --follow-symlinks --delete --cache-control 's-maxage=604800, max-age=0'
env:
AWS_S3_BUCKET: ${{ needs.getinfo.outputs.websites3bucket }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-2'
SOURCE_DIR: 'docs/build'
- name: Purge Cloudflare Cache
run: |
curl -X POST "https://api.cloudflare.com/client/v4/zones/$ZONE/purge_cache" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
--data '{"purge_everything":true}'
env:
TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
ZONE: ${{ secrets.CLOUDFLARE_ZONE }}