|
1 | | -name: Automated Deployment |
2 | | - |
3 | | -on: |
| 1 | +name: Automated |
| 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 | |
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 | | - @semantic-release/npm |
44 | 28 | @semantic-release/git |
45 | 29 | @semantic-release/github |
46 | 30 | env: |
47 | | - GITHUB_TOKEN: ${{ secrets.GITHUB }} |
48 | | - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # Auto Changog generator |
| 31 | + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
| 32 | + NPM_TOKEN: "${{ secrets.NPM_TOKEN }}" |
49 | 33 | outputs: |
50 | | - new_release_published: ${{ steps.semantic.outputs.new_release_published }} |
51 | | - new_release_version: ${{ steps.semantic.outputs.new_release_version }} |
52 | | - |
53 | | - |
54 | | - build: |
| 34 | + new_release_published: "${{ steps.semantic.outputs.new_release_published }}" |
| 35 | + new_release_version: "${{ steps.semantic.outputs.new_release_version }}" |
| 36 | + cdn: |
55 | 37 | runs-on: ubuntu-latest |
56 | 38 | needs: release |
57 | 39 | if: needs.release.outputs.new_release_published == 'true' |
58 | 40 | env: |
59 | | - IMAGE: cocreateapps/cocreate-docs |
60 | | - VERSION: ${{ needs.release.outputs.new_release_version }} |
| 41 | + VERSION: "${{ needs.release.outputs.new_release_version }}" |
| 42 | + steps: |
| 43 | + - name: Checkout |
| 44 | + uses: actions/checkout@v2 |
| 45 | + - name: setup nodejs |
| 46 | + uses: actions/setup-node@v2 |
| 47 | + with: |
| 48 | + node-version: 14.15.4 |
| 49 | + - name: yarn install |
| 50 | + run: > |
| 51 | + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > |
| 52 | + .npmrc |
| 53 | +
|
| 54 | + yarn install |
| 55 | + - name: yarn build |
| 56 | + run: yarn build |
| 57 | + - name: upload bundle as version |
| 58 | + uses: CoCreate-app/CoCreate-s3@master |
| 59 | + with: |
| 60 | + aws-key-id: "${{ secrets.AWSACCESSKEYID }}" |
| 61 | + aws-access-key: "${{ secrets.AWSSECERTACCESSKEY }}" |
| 62 | + bucket: testcrudbucket |
| 63 | + source: ./dist |
| 64 | + destination: "/docs/${{env.VERSION}}" |
| 65 | + acl: public-read |
| 66 | + - name: upload bundle as latest |
| 67 | + uses: CoCreate-app/CoCreate-s3@master |
| 68 | + with: |
| 69 | + aws-key-id: "${{ secrets.AWSACCESSKEYID }}" |
| 70 | + aws-access-key: "${{ secrets.AWSSECERTACCESSKEY }}" |
| 71 | + bucket: testcrudbucket |
| 72 | + source: ./dist |
| 73 | + destination: /docs/latest |
| 74 | + acl: public-read |
| 75 | + invalidations: true |
| 76 | + docs: |
| 77 | + runs-on: ubuntu-latest |
61 | 78 | steps: |
62 | | - - uses: actions/checkout@v2 |
63 | | - - name: Login to DockerHub |
64 | | - uses: docker/login-action@v1 |
65 | | - with: |
66 | | - username: ${{ secrets.DOCKERHUB_USER }} |
67 | | - password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} |
68 | | - - name: docker build |
69 | | - id: docker_build |
70 | | - run: docker build . -t ${IMAGE}:latest -t ${IMAGE}:${VERSION} |
71 | | - - name: docker push |
72 | | - id: docker_push |
73 | | - run: | |
74 | | - docker push ${IMAGE}:latest |
75 | | - docker push ${IMAGE}:${VERSION} |
| 79 | + - name: Checkout |
| 80 | + uses: actions/checkout@v2 |
| 81 | + |
| 82 | + - name: update documentation |
| 83 | + uses: CoCreate-app/CoCreate-docs@master |
0 commit comments