|
8 | 8 | - develop |
9 | 9 |
|
10 | 10 | jobs: |
11 | | - # preflight-checks: |
12 | | - # name: Preflight checks |
13 | | - # runs-on: ubuntu-latest |
14 | | - # steps: |
15 | | - # - name: Check if there are config-sync changes on production |
16 | | - # uses: appleboy/ssh-action@v0.1.10 |
17 | | - # with: |
18 | | - # host: ${{ secrets.SSH_HOST }} |
19 | | - # username: ${{ secrets.SSH_CI_USERNAME }} |
20 | | - # password: ${{ secrets.SSH_CI_PASSWORD }} |
21 | | - # script_stop: true |
22 | | - # script: dokku run strapi ../node_modules/.bin/config-sync diff |
| 11 | + preflight-checks: |
| 12 | + name: Preflight checks |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - name: Check if there are config-sync changes on production |
| 16 | + uses: appleboy/ssh-action@v0.1.10 |
| 17 | + with: |
| 18 | + host: ${{ secrets.SSH_HOST }} |
| 19 | + username: ${{ secrets.SSH_CI_USERNAME }} |
| 20 | + password: ${{ secrets.SSH_CI_PASSWORD }} |
| 21 | + script_stop: true |
| 22 | + script: dokku run strapi ../node_modules/.bin/config-sync diff |
23 | 23 | deploy: |
24 | 24 | name: Deploy |
25 | | - # needs: [preflight-checks] |
| 25 | + needs: [preflight-checks] |
26 | 26 | runs-on: ubuntu-latest |
27 | 27 | environment: |
28 | 28 | name: Test |
29 | 29 | url: https://test.pluginpal.io |
30 | | - # steps: |
31 | | - # - name: Checkout repository |
32 | | - # uses: actions/checkout@v2 |
| 30 | + steps: |
| 31 | + - name: Checkout repository |
| 32 | + uses: actions/checkout@v2 |
33 | 33 |
|
34 | | - # - name: Set up Docker |
35 | | - # uses: actions/setup-node@v3 |
36 | | - # with: |
37 | | - # node-version: 18 |
38 | | - # cache: 'yarn' |
| 34 | + - name: Set up Docker |
| 35 | + uses: actions/setup-node@v3 |
| 36 | + with: |
| 37 | + node-version: 18 |
| 38 | + cache: 'yarn' |
39 | 39 |
|
40 | | - # - name: Install plugin dependencies |
41 | | - # run: yarn install |
| 40 | + - name: Install plugin dependencies |
| 41 | + run: yarn install |
42 | 42 |
|
43 | | - # - name: Build the packages |
44 | | - # run: yarn run build |
| 43 | + - name: Build the packages |
| 44 | + run: yarn run build |
45 | 45 |
|
46 | | - # - name: Install de playground dependencies |
47 | | - # run: yarn playground:install |
| 46 | + - name: Install de playground dependencies |
| 47 | + run: yarn playground:install |
48 | 48 |
|
49 | | - # - name: Build a Docker image of the playground |
50 | | - # run: | |
51 | | - # cd playground |
52 | | - # docker build \ |
53 | | - # --build-arg PUBLIC_URL=${{ secrets.TEST_URL }} \ |
54 | | - # -t strapi-playground:latest . |
55 | | - # docker save -o strapi-playground-latest.tar strapi-playground:latest |
| 49 | + - name: Build a Docker image of the playground |
| 50 | + run: | |
| 51 | + cd playground |
| 52 | + docker build \ |
| 53 | + --build-arg PUBLIC_URL=${{ secrets.TEST_URL }} \ |
| 54 | + -t strapi-playground:latest . |
| 55 | + docker save -o strapi-playground-latest.tar strapi-playground:latest |
56 | 56 |
|
57 | | - # - name: Transfer the Docker image to the Dokku server |
58 | | - # uses: appleboy/scp-action@v0.1.3 |
59 | | - # with: |
60 | | - # host: ${{ secrets.SSH_HOST }} |
61 | | - # username: ${{ secrets.SSH_CI_USERNAME }} |
62 | | - # password: ${{ secrets.SSH_CI_PASSWORD }} |
63 | | - # source: playground/strapi-playground-latest.tar |
64 | | - # target: /var/lib/dokku/data/storage/strapi/docker-images |
| 57 | + - name: Transfer the Docker image to the Dokku server |
| 58 | + uses: appleboy/scp-action@v0.1.3 |
| 59 | + with: |
| 60 | + host: ${{ secrets.SSH_HOST }} |
| 61 | + username: ${{ secrets.SSH_CI_USERNAME }} |
| 62 | + password: ${{ secrets.SSH_CI_PASSWORD }} |
| 63 | + source: playground/strapi-playground-latest.tar |
| 64 | + target: /var/lib/dokku/data/storage/strapi/docker-images |
65 | 65 |
|
66 | | - # - name: Deploy the Dokku app based on the Docker image |
67 | | - # uses: appleboy/ssh-action@v0.1.10 |
68 | | - # with: |
69 | | - # host: ${{ secrets.SSH_HOST }} |
70 | | - # username: ${{ secrets.SSH_CI_USERNAME }} |
71 | | - # password: ${{ secrets.SSH_CI_PASSWORD }} |
72 | | - # script_stop: true |
73 | | - # script: | |
74 | | - # sudo docker load -i /var/lib/dokku/data/storage/strapi/docker-images/playground/strapi-playground-latest.tar |
75 | | - # STRAPI_LATEST_IMAGE=$(sudo docker images --format "{{.ID}}" strapi-playground:latest) |
76 | | - # sudo docker tag strapi-playground:latest strapi-playground:$STRAPI_LATEST_IMAGE |
77 | | - # dokku git:from-image strapi strapi-playground:$STRAPI_LATEST_IMAGE |
78 | | - # sudo docker system prune --all --force |
79 | | - # sudo rm -rf /var/lib/dokku/data/storage/strapi/docker-images/playground/strapi-playground-latest.tar |
| 66 | + - name: Deploy the Dokku app based on the Docker image |
| 67 | + uses: appleboy/ssh-action@v0.1.10 |
| 68 | + with: |
| 69 | + host: ${{ secrets.SSH_HOST }} |
| 70 | + username: ${{ secrets.SSH_CI_USERNAME }} |
| 71 | + password: ${{ secrets.SSH_CI_PASSWORD }} |
| 72 | + script_stop: true |
| 73 | + script: | |
| 74 | + sudo docker load -i /var/lib/dokku/data/storage/strapi/docker-images/playground/strapi-playground-latest.tar |
| 75 | + STRAPI_LATEST_IMAGE=$(sudo docker images --format "{{.ID}}" strapi-playground:latest) |
| 76 | + sudo docker tag strapi-playground:latest strapi-playground:$STRAPI_LATEST_IMAGE |
| 77 | + dokku git:from-image strapi strapi-playground:$STRAPI_LATEST_IMAGE |
| 78 | + sudo docker system prune --all --force |
| 79 | + sudo rm -rf /var/lib/dokku/data/storage/strapi/docker-images/playground/strapi-playground-latest.tar |
80 | 80 |
|
0 commit comments