@@ -4,7 +4,6 @@ name: Deploy-To-Control-Plane
4
4
description : ' Deploys both to staging and to review apps'
5
5
6
6
inputs :
7
- # The name of the app to deploy
8
7
app_name :
9
8
description : ' The name of the app to deploy'
10
9
required : true
@@ -20,25 +19,25 @@ runs:
20
19
- name : Set up Ruby
21
20
uses : ruby/setup-ruby@v1
22
21
with :
23
- ruby-version : ' 3.2 ' # Specify your Ruby version here
22
+ ruby-version : ' 3.3.3 ' # Specify your Ruby version here
24
23
25
24
- name : Install Control Plane CLI
26
25
shell : bash
27
26
run : |
28
27
sudo npm install -g @controlplane/[email protected]
29
28
cpln --version
30
29
gem install cpflow -v 4.0.0
30
+ cpflow --version
31
31
32
32
- name : Set Short SHA
33
33
id : vars
34
34
shell : bash
35
35
run : echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
36
36
37
- - name : cpflow profile
37
+ - name : cpln profile
38
38
shell : bash
39
39
run : |
40
40
cpln profile update default
41
- # cpln profile update default --token ${CPLN_TOKEN}
42
41
43
42
# Caching step
44
43
- uses : actions/cache@v2
@@ -49,22 +48,24 @@ runs:
49
48
${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile', '**/package.json', '**/yarn.lock') }}
50
49
${{ runner.os }}-docker-
51
50
51
+ - name : cpflow setup-app
52
+ shell : bash
53
+ run : |
54
+ if ! cpflow exists -a ${{ inputs.app_name }} ; then
55
+ cpflow setup-app -a ${{ inputs.app_name }}
56
+ fi
57
+ # Provision all infrastructure on Control Plane.
58
+ # app react-webpack-rails-tutorial will be created per definition in .controlplane/controlplane.yml
52
59
- name : cpflow build-image
53
60
shell : bash
54
61
run : |
55
62
cpln image docker-login
63
+ # Use BUILDKIT_PROGRESS=plain to get more verbose logging of the build
64
+ # BUILDKIT_PROGRESS=plain cpflow build-image -a ${{ inputs.app_name }} --commit ${{steps.vars.outputs.sha_short}} --org ${{inputs.org}}
56
65
cpflow build-image -a ${{ inputs.app_name }} --commit ${{steps.vars.outputs.sha_short}} --org ${{inputs.org}}
57
- # --cache /tmp/.docker-cache
58
-
59
- - name : Run release script
60
- shell : bash
61
- run : |
62
- # Run database migrations (or other release tasks) with the latest image,
63
- # while the app is still running on the previous image.
64
- # This is analogous to the release phase.
65
- cpflow run './.controlplane/release_script.sh' -a ${{ inputs.app_name }} --image latest
66
-
66
+ # --cache /tmp/.docker-cache
67
67
- name : Deploy to Control Plane
68
68
shell : bash
69
69
run : |
70
- cpflow deploy-image -a ${{ inputs.app_name }} --org ${{inputs.org}}
70
+ echo "Deploying to Control Plane"
71
+ cpflow deploy-image -a ${{ inputs.app_name }} --run-release-phase --org ${{inputs.org}} --verbose
0 commit comments