|
1 | | -name: Automated Deployment |
2 | | - |
3 | | -on: |
| 1 | +name: Automated Workflow |
| 2 | +"on": |
4 | 3 | push: |
5 | 4 | branches: |
6 | 5 | - master |
7 | | - |
8 | 6 | jobs: |
9 | 7 | about: |
10 | 8 | runs-on: ubuntu-latest |
11 | 9 | steps: |
12 | 10 | - name: Checkout |
13 | 11 | uses: actions/checkout@v2 |
14 | | - |
15 | 12 | - name: Jaid/action-sync-node-meta |
16 | 13 | uses: jaid/action-sync-node-meta@v1.4.0 |
17 | 14 | with: |
18 | | - direction: overwrite-github # default is overwrite-file |
19 | | - githubToken: ${{ secrets.GITHUB }} |
20 | | - |
21 | | - # docs: |
22 | | - # runs-on: ubuntu-latest |
23 | | - # steps: |
24 | | - # - name: Checkout |
25 | | - # uses: actions/checkout@v2 |
26 | | - |
27 | | - # - name: update documentation |
28 | | - # uses: CoCreate-app/CoCreate-docs@master |
29 | | - |
| 15 | + direction: overwrite-github |
| 16 | + githubToken: "${{ secrets.GITHUB }}" |
30 | 17 | release: |
31 | 18 | runs-on: ubuntu-latest |
32 | 19 | steps: |
33 | 20 | - name: Checkout |
34 | 21 | uses: actions/checkout@v2 |
35 | | - |
36 | 22 | - name: Semantic Release |
37 | 23 | uses: cycjimmy/semantic-release-action@v2 |
38 | 24 | id: semantic |
39 | 25 | with: |
40 | | - # You can specify specifying version range for the extra plugins if you prefer. |
41 | 26 | extra_plugins: | |
42 | 27 | @semantic-release/changelog |
43 | 28 | @semantic-release/npm |
44 | 29 | @semantic-release/git |
45 | 30 | @semantic-release/github |
46 | 31 | env: |
47 | | - GITHUB_TOKEN: ${{ secrets.GITHUB }} |
48 | | - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # Auto Changog generator |
| 32 | + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
| 33 | + NPM_TOKEN: "${{ secrets.NPM_TOKEN }}" |
49 | 34 | outputs: |
50 | | - new_release_published: ${{ steps.semantic.outputs.new_release_published }} |
51 | | - new_release_version: ${{ steps.semantic.outputs.new_release_version }} |
52 | | - |
53 | | - # package: |
54 | | - # runs-on: ubuntu-latest |
55 | | - # needs: release |
56 | | - # if: needs.release.outputs.new_release_published == 'true' |
57 | | - # env: |
58 | | - # IMAGE: docker.pkg.github.com/cocreate-app/cocreate-docs/cocreate-docs |
59 | | - # VERSION: ${{ needs.release.outputs.new_release_version }} |
60 | | - # steps: |
61 | | - # - name: Checkout repository |
62 | | - # uses: actions/checkout@v1 |
63 | | - |
64 | | - # - name: npm login |
65 | | - # env: |
66 | | - # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
67 | | - # run: > |
68 | | - # echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > |
69 | | - # .npmrc |
70 | | - # - name: Login docker registry |
71 | | - # env: |
72 | | - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
73 | | - # run: | |
74 | | - # docker login docker.pkg.github.com -u ${GITHUB_ACTOR} -p ${GITHUB_TOKEN} |
75 | | - |
76 | | - # - name: Build docker image |
77 | | - # run: docker build . -t ${IMAGE}:latest -t ${IMAGE}:${VERSION} |
78 | | - |
79 | | - # - name: Push docker image |
80 | | - # run: | |
81 | | - # docker push ${IMAGE}:latest |
82 | | - # docker push ${IMAGE}:${VERSION} |
83 | | - |
84 | | - build: |
| 35 | + new_release_published: "${{ steps.semantic.outputs.new_release_published }}" |
| 36 | + new_release_version: "${{ steps.semantic.outputs.new_release_version }}" |
| 37 | + cdn: |
85 | 38 | runs-on: ubuntu-latest |
86 | 39 | needs: release |
87 | 40 | if: needs.release.outputs.new_release_published == 'true' |
88 | 41 | env: |
89 | | - IMAGE: cocreateapps/cocreate-docs |
90 | | - VERSION: ${{ needs.release.outputs.new_release_version }} |
| 42 | + VERSION: "${{ needs.release.outputs.new_release_version }}" |
91 | 43 | steps: |
92 | | - - uses: actions/checkout@v2 |
93 | | - - name: Login to DockerHub |
94 | | - uses: docker/login-action@v1 |
95 | | - with: |
96 | | - username: ${{ secrets.DOCKERHUB_USER }} |
97 | | - password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} |
98 | | - - name: docker build |
99 | | - id: docker_build |
100 | | - run: docker build . -t ${IMAGE}:latest -t ${IMAGE}:${VERSION} |
101 | | - - name: docker push |
102 | | - id: docker_push |
103 | | - run: | |
104 | | - docker push ${IMAGE}:latest |
105 | | - docker push ${IMAGE}:${VERSION} |
106 | | -# - name: Image digest |
107 | | -# run: echo ${{ steps.docker_push.outputs.digest }} |
| 44 | + - name: Checkout |
| 45 | + uses: actions/checkout@v2 |
| 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: "/docs/${{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: /docs/latest |
| 75 | + acl: public-read |
| 76 | + invalidations: true |
| 77 | + docs: |
| 78 | + runs-on: ubuntu-latest |
| 79 | + steps: |
| 80 | + - name: Checkout |
| 81 | + uses: actions/checkout@v2 |
108 | 82 |
|
| 83 | + - name: update documentation |
| 84 | + uses: CoCreate-app/CoCreate-docs@master |
0 commit comments