|
1 | | -name: Automated Workflow |
2 | | -"on": |
| 1 | +name: Automated Deployment |
| 2 | + |
| 3 | +on: |
3 | 4 | push: |
4 | 5 | branches: |
5 | 6 | - master |
| 7 | + |
6 | 8 | jobs: |
7 | 9 | about: |
8 | 10 | runs-on: ubuntu-latest |
9 | 11 | steps: |
10 | 12 | - name: Checkout |
11 | 13 | uses: actions/checkout@v2 |
| 14 | + |
12 | 15 | - name: Jaid/action-sync-node-meta |
13 | 16 | uses: jaid/action-sync-node-meta@v1.4.0 |
14 | 17 | with: |
15 | | - direction: overwrite-github |
16 | | - githubToken: "${{ secrets.GITHUB }}" |
| 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 | + |
17 | 30 | release: |
18 | 31 | runs-on: ubuntu-latest |
19 | 32 | steps: |
20 | 33 | - name: Checkout |
21 | 34 | uses: actions/checkout@v2 |
| 35 | + |
22 | 36 | - name: Semantic Release |
23 | 37 | uses: cycjimmy/semantic-release-action@v2 |
24 | 38 | id: semantic |
25 | 39 | with: |
| 40 | + # You can specify specifying version range for the extra plugins if you prefer. |
26 | 41 | extra_plugins: | |
27 | 42 | @semantic-release/changelog |
28 | 43 | @semantic-release/npm |
29 | 44 | @semantic-release/git |
30 | 45 | @semantic-release/github |
31 | 46 | env: |
32 | | - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
33 | | - NPM_TOKEN: "${{ secrets.NPM_TOKEN }}" |
| 47 | + GITHUB_TOKEN: ${{ secrets.GITHUB }} |
| 48 | + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # Auto Changog generator |
34 | 49 | outputs: |
35 | | - new_release_published: "${{ steps.semantic.outputs.new_release_published }}" |
36 | | - new_release_version: "${{ steps.semantic.outputs.new_release_version }}" |
37 | | - cdn: |
| 50 | + new_release_published: ${{ steps.semantic.outputs.new_release_published }} |
| 51 | + new_release_version: ${{ steps.semantic.outputs.new_release_version }} |
| 52 | + |
| 53 | + |
| 54 | + build: |
38 | 55 | runs-on: ubuntu-latest |
39 | 56 | needs: release |
40 | 57 | if: needs.release.outputs.new_release_published == 'true' |
41 | 58 | env: |
42 | | - VERSION: "${{ needs.release.outputs.new_release_version }}" |
43 | | - steps: |
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 |
| 59 | + IMAGE: cocreateapps/cocreate-docs |
| 60 | + VERSION: ${{ needs.release.outputs.new_release_version }} |
79 | 61 | steps: |
80 | | - - name: Checkout |
81 | | - uses: actions/checkout@v2 |
82 | | - |
83 | | - - name: update documentation |
84 | | - uses: CoCreate-app/CoCreate-docs@master |
| 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} |
0 commit comments