Skip to content

Commit 6a95f76

Browse files
committed
fix: ci and build process
1 parent 5fa9f22 commit 6a95f76

File tree

1 file changed

+68
-34
lines changed

1 file changed

+68
-34
lines changed

.github/workflows/automation.yml

+68-34
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,101 @@
11
name: CI
2-
3-
on:
2+
"on":
43
push:
54
branches:
6-
- master
7-
pull_request:
8-
branches:
9-
- master
10-
create:
11-
branches:
12-
- master
13-
5+
- master
146
jobs:
15-
updateKeyword:
7+
about:
168
runs-on: ubuntu-latest
179
steps:
1810
- name: Checkout
1911
uses: actions/checkout@v2
20-
2112
- name: Jaid/action-sync-node-meta
2213
uses: jaid/[email protected]
2314
with:
24-
direction: overwrite-github # default is overwrite-file
25-
githubToken: ${{ secrets.GITHUB }}
26-
27-
ci:
15+
direction: overwrite-github
16+
githubToken: "${{ secrets.GITHUB }}"
17+
release:
2818
runs-on: ubuntu-latest
2919
steps:
3020
- name: Checkout
3121
uses: actions/checkout@v2
32-
3322
- name: Semantic Release
3423
uses: cycjimmy/semantic-release-action@v2
24+
id: semantic
3525
with:
36-
# You can specify specifying version range for the extra plugins if you prefer.
3726
extra_plugins: |
3827
@semantic-release/changelog
3928
@semantic-release/npm
4029
@semantic-release/git
4130
@semantic-release/github
4231
env:
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # Auto Changog generator
45-
46-
docs:
32+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
33+
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
34+
outputs:
35+
new_release_published: "${{ steps.semantic.outputs.new_release_published }}"
36+
new_release_version: "${{ steps.semantic.outputs.new_release_version }}"
37+
cdn:
4738
runs-on: ubuntu-latest
39+
needs: release
40+
if: needs.release.outputs.new_release_published == 'true'
41+
env:
42+
VERSION: "${{ needs.release.outputs.new_release_version }}"
4843
steps:
4944
- name: Checkout
5045
uses: actions/checkout@v2
51-
52-
- name: update documentation
53-
uses: CoCreate-app/CoCreate-docs@master
54-
55-
56-
cdn:
46+
- name: setup nodejs
47+
uses: actions/setup-node@v2
48+
with:
49+
node-version: 14.15.4
50+
- name: yarn install
51+
run: >
52+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >
53+
.npmrc
54+
55+
yarn install
56+
- name: yarn build
57+
run: yarn build
58+
- name: upload bundle as version
59+
uses: CoCreate-app/CoCreate-s3@master
60+
with:
61+
aws-key-id: "${{ secrets.AWSACCESSKEYID }}"
62+
aws-access-key: "${{ secrets.AWSSECERTACCESSKEY }}"
63+
bucket: testcrudbucket
64+
source: ./dist
65+
destination: "/kanban/${{env.VERSION}}"
66+
acl: public-read
67+
- name: upload bundle as latest
68+
uses: CoCreate-app/CoCreate-s3@master
69+
with:
70+
aws-key-id: "${{ secrets.AWSACCESSKEYID }}"
71+
aws-access-key: "${{ secrets.AWSSECERTACCESSKEY }}"
72+
bucket: testcrudbucket
73+
source: ./dist
74+
destination: /kanban/latest
75+
acl: public-read
76+
77+
dist:
5778
runs-on: ubuntu-latest
5879
steps:
5980
- name: Checkout
6081
uses: actions/checkout@v2
61-
62-
- name: upload cdn
63-
uses: CoCreate-app/CoCreate-s3@master
6482
with:
65-
aws-key-id: ${{ secrets.AWSACCESSKEYID }}
66-
aws-access-key: ${{ secrets.AWSSECERTACCESSKEY }}
67-
source: './dist/CoCreate-kanban.min.js'
83+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
84+
- name: setup nodejs
85+
uses: actions/setup-node@v2
86+
with:
87+
node-version: 14.15.4
88+
- name: yarn install
89+
run: >
90+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >
91+
.npmrc
92+
93+
yarn install
94+
- run: yarn build
95+
- run: git add .
96+
- run: git config user.email "[email protected]"
97+
- run: git config user.name "frank pagan"
98+
- run: git commit --allow-empty -m "add dist bundle"
99+
- run: git pull origin master
100+
- run: git commit --allow-empty -m "add dist bundle"
101+
- run: git push origin master

0 commit comments

Comments
 (0)