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