|
1 | 1 | # Control Plane GitHub Action |
2 | 2 |
|
3 | | -name: Deploy-To-Control-Plane |
| 3 | +name: Deploy-To-Control-Plane-Staging |
4 | 4 |
|
5 | 5 | # Controls when the workflow will run |
6 | 6 | on: |
|
24 | 24 | - name: Check out the repo |
25 | 25 | uses: actions/checkout@v2 |
26 | 26 |
|
27 | | - - name: Set up Ruby |
28 | | - uses: ruby/setup-ruby@v1 |
| 27 | + - uses: ./.github/actions/deploy-to-control-plane |
29 | 28 | with: |
30 | | - ruby-version: '3.2' # Specify your Ruby version here |
31 | | - |
32 | | - - name: Install Control Plane CLI |
33 | | - shell: bash |
34 | | - run: | |
35 | | - sudo npm install -g @controlplane/cli |
36 | | - cpln --version |
37 | | - gem install cpl -v 1.2.0 |
38 | | -
|
39 | | - - name: Set Short SHA |
40 | | - id: vars |
41 | | - run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" |
42 | | - |
43 | | - - name: cpl profile |
44 | | - run: | |
45 | | - cpln profile update default |
46 | | -# cpln profile update default --token ${CPLN_TOKEN} |
47 | | - |
48 | | - # Caching step |
49 | | - - uses: actions/cache@v2 |
50 | | - with: |
51 | | - path: /tmp/.docker-cache |
52 | | - key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile', '**/package.json', '**/yarn.lock') }}-${{ github.sha }} |
53 | | - restore-keys: | |
54 | | - ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile', '**/package.json', '**/yarn.lock') }} |
55 | | - ${{ runner.os }}-docker- |
56 | | -
|
57 | | - - name: cpl build-image |
58 | | - run: | |
59 | | - cpln image docker-login |
60 | | - cpl build-image -a ${{ secrets.APP_NAME_STAGING }} --commit ${{steps.vars.outputs.sha_short}} --org ${{secrets.CPLN_ORG_STAGING}} |
61 | | -
|
62 | | - - name: Run release script |
63 | | - run: | |
64 | | - # Run database migrations (or other release tasks) with the latest image, |
65 | | - # while the app is still running on the previous image. |
66 | | - # This is analogous to the release phase. |
67 | | - cpl run:detached './.controlplane/release_script.sh' -a ${{ secrets.APP_NAME_STAGING }} --image latest |
68 | | -
|
69 | | - - name: Deploy to Control Plane |
70 | | - run: | |
71 | | - cpl deploy-image -a ${{ secrets.APP_NAME_STAGING }} --org ${{secrets.CPLN_ORG_STAGING}} |
| 29 | + app_name: ${{ secrets.APP_NAME_STAGING }} |
| 30 | + org: ${{ secrets.CPLN_ORG_STAGING }} |
0 commit comments