|
7 | 7 | name: Test |
8 | 8 | runs-on: ubuntu-latest |
9 | 9 | steps: |
10 | | - - uses: actions/checkout@v2 |
11 | | - - uses: actions/setup-node@v1 |
12 | | - with: |
13 | | - node-version: '15' |
14 | | - check-latest: true |
15 | | - - name: Cache node modules |
16 | | - uses: actions/cache@v2 |
17 | | - with: |
18 | | - path: node_modules |
19 | | - key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }} |
20 | | - restore-keys: | |
21 | | - ${{ runner.OS }}-build-${{ env.cache-name }}- |
22 | | - ${{ runner.OS }}-build- |
23 | | - ${{ runner.OS }}- |
24 | | - - run: make envvar |
| 10 | + - uses: actions/checkout@v2 |
25 | 11 |
|
26 | | - # Pull the latest image to build, and avoid caching pull-only images. |
27 | | - # (docker pull is faster than caching in most cases.) |
28 | | - - run: docker-compose pull |
| 12 | + - uses: actions/setup-node@v2 |
| 13 | + with: |
| 14 | + node-version: "15" |
| 15 | + check-latest: true |
29 | 16 |
|
30 | | - # In this step, this action saves a list of existing images, |
31 | | - # the cache is created without them in the post run. |
32 | | - # It also restores the cache if it exists. |
33 | | - - uses: satackey/action-docker-layer-caching@v0.0.11 |
34 | | - # Ignore the failure of a step and avoid terminating the job. |
35 | | - continue-on-error: true |
| 17 | + - name: Cache node modules |
| 18 | + uses: actions/cache@v2 |
| 19 | + with: |
| 20 | + path: node_modules |
| 21 | + key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }} |
| 22 | + restore-keys: | |
| 23 | + ${{ runner.OS }}-build-${{ env.cache-name }}- |
| 24 | + ${{ runner.OS }}-build- |
| 25 | + ${{ runner.OS }}- |
36 | 26 |
|
37 | | - - run: make image |
| 27 | + - run: make envvar |
38 | 28 |
|
39 | | - - run: make test |
| 29 | + # Pull the latest image to build, and avoid caching pull-only images. |
| 30 | + # (docker pull is faster than caching in most cases.) |
| 31 | + - run: docker-compose pull |
| 32 | + |
| 33 | + # In this step, this action saves a list of existing images, |
| 34 | + # the cache is created without them in the post run. |
| 35 | + # It also restores the cache if it exists. |
| 36 | + - uses: satackey/action-docker-layer-caching@v0.0.11 |
| 37 | + # Ignore the failure of a step and avoid terminating the job. |
| 38 | + continue-on-error: true |
| 39 | + |
| 40 | + - run: make image |
| 41 | + |
| 42 | + - run: make test |
40 | 43 |
|
41 | 44 | deploy: |
42 | 45 | name: Deploy |
43 | 46 | runs-on: ubuntu-latest |
44 | 47 | needs: [test] |
45 | 48 | steps: |
46 | | - - name: Cancel Previous Runs |
47 | | - uses: styfle/cancel-workflow-action@0.4.0 |
48 | | - with: |
49 | | - access_token: ${{ github.token }} |
| 49 | + - name: Cancel Previous Runs |
| 50 | + uses: styfle/cancel-workflow-action@0.4.0 |
| 51 | + with: |
| 52 | + access_token: ${{ github.token }} |
50 | 53 |
|
51 | | - - name: Checkout |
52 | | - uses: actions/checkout@v2 |
53 | | - with: |
54 | | - fetch-depth: 0 |
| 54 | + - name: Checkout |
| 55 | + uses: actions/checkout@v2 |
| 56 | + with: |
| 57 | + fetch-depth: 0 |
55 | 58 |
|
56 | | - - name: Push |
57 | | - uses: dokku/github-action@v1 |
58 | | - # enable verbose ssh output |
59 | | - with: |
60 | | - # specify `--force` as a flag for git pushes |
61 | | - git_push_flags: '--force' |
62 | | - git_remote_url: ${{ secrets.SSH_REMOTE_URL }} |
63 | | - ssh_private_key: ${{ secrets.PRIVATE_KEY }} |
| 59 | + - name: Push |
| 60 | + uses: dokku/github-action@v1 |
| 61 | + # enable verbose ssh output |
| 62 | + with: |
| 63 | + # specify `--force` as a flag for git pushes |
| 64 | + git_push_flags: "--force" |
| 65 | + git_remote_url: ${{ secrets.SSH_REMOTE_URL }} |
| 66 | + ssh_private_key: ${{ secrets.PRIVATE_KEY }} |
64 | 67 |
|
65 | | - - name: Create Sentry release |
66 | | - uses: getsentry/action-release@v1 |
67 | | - env: |
68 | | - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} |
69 | | - SENTRY_ORG: ${{ secrets.SENTRY_ORG }} |
70 | | - SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} |
71 | | - with: |
72 | | - environment: production |
| 68 | + - name: Create Sentry release |
| 69 | + uses: getsentry/action-release@v1 |
| 70 | + env: |
| 71 | + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} |
| 72 | + SENTRY_ORG: ${{ secrets.SENTRY_ORG }} |
| 73 | + SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} |
| 74 | + with: |
| 75 | + environment: production |
0 commit comments