Skip to content

Deploy on merge to master #577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .github/workflows/deploy-to-control-plane.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ name: Deploy-To-Control-Plane
# Controls when the workflow will run
on:
# 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

# push:
# branches: [main]
push:
branches: [main]
Comment on lines +8 to +9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did it work?

We don't main branch. We have master.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. It got fixed in 4890a54

# pull_request:
# branches: [main]

Expand All @@ -20,7 +19,7 @@ env:
CPLN_TOKEN: ${{secrets.CPLN_TOKEN}}

jobs:
build-image-for-control-plane:
deploy-to-control-plane:
runs-on: ubuntu-latest

steps:
Expand All @@ -47,7 +46,19 @@ jobs:
run: |
cpln profile update default --token ${CPLN_TOKEN}

# Caching step
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahangarha @Judahmeek this caching might not be doing anything. Please research.

- uses: actions/cache@v2
with:
path: /tmp/docker-layers
key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile') }}
restore-keys: |
${{ runner.os }}-docker-

- name: cpl build-image
run: |
cpln image docker-login
cpl build-image -a ${{ secrets.APP_NAME_STAGING }} --commit ${{steps.vars.outputs.sha_short}}

- name: Deploy to Control Plane
run: |
cpl deploy-image -a ${{ secrets.APP_NAME_STAGING }}