@@ -4,7 +4,6 @@ name: Deploy-To-Control-Plane
44description : ' Deploys both to staging and to review apps'
55
66inputs :
7- # The name of the app to deploy
87 app_name :
98 description : ' The name of the app to deploy'
109 required : true
@@ -20,25 +19,25 @@ runs:
2019 - name : Set up Ruby
2120 uses : ruby/setup-ruby@v1
2221 with :
23- ruby-version : ' 3.2 ' # Specify your Ruby version here
22+ ruby-version : ' 3.3.3 ' # Specify your Ruby version here
2423
2524 - name : Install Control Plane CLI
2625 shell : bash
2726 run : |
2827 sudo npm install -g @controlplane/cli@3.1.0
2928 cpln --version
3029 gem install cpflow -v 4.0.0
30+ cpflow --version
3131
3232 - name : Set Short SHA
3333 id : vars
3434 shell : bash
3535 run : echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
3636
37- - name : cpflow profile
37+ - name : cpln profile
3838 shell : bash
3939 run : |
4040 cpln profile update default
41- # cpln profile update default --token ${CPLN_TOKEN}
4241
4342 # Caching step
4443 - uses : actions/cache@v2
@@ -49,22 +48,24 @@ runs:
4948 ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile', '**/package.json', '**/yarn.lock') }}
5049 ${{ runner.os }}-docker-
5150
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
5259 - name : cpflow build-image
5360 shell : bash
5461 run : |
5562 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}}
5665 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
6767 - name : Deploy to Control Plane
6868 shell : bash
6969 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