Skip to content

Commit fbcbd31

Browse files
authored
Deploy on merge to master (#577)
1 parent af084f9 commit fbcbd31

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/deploy-to-control-plane.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ name: Deploy-To-Control-Plane
55
# Controls when the workflow will run
66
on:
77
# Uncomment the lines you want actions that will cause the workflow to Triggers the workflow on push or pull request events but only for the main branch
8-
9-
# push:
10-
# branches: [main]
8+
push:
9+
branches: [main]
1110
# pull_request:
1211
# branches: [main]
1312

@@ -20,7 +19,7 @@ env:
2019
CPLN_TOKEN: ${{secrets.CPLN_TOKEN}}
2120

2221
jobs:
23-
build-image-for-control-plane:
22+
deploy-to-control-plane:
2423
runs-on: ubuntu-latest
2524

2625
steps:
@@ -47,7 +46,19 @@ jobs:
4746
run: |
4847
cpln profile update default --token ${CPLN_TOKEN}
4948
49+
# Caching step
50+
- uses: actions/cache@v2
51+
with:
52+
path: /tmp/docker-layers
53+
key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile') }}
54+
restore-keys: |
55+
${{ runner.os }}-docker-
56+
5057
- name: cpl build-image
5158
run: |
5259
cpln image docker-login
5360
cpl build-image -a ${{ secrets.APP_NAME_STAGING }} --commit ${{steps.vars.outputs.sha_short}}
61+
62+
- name: Deploy to Control Plane
63+
run: |
64+
cpl deploy-image -a ${{ secrets.APP_NAME_STAGING }}

0 commit comments

Comments
 (0)