Skip to content

ci: deploy app from ci #772

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 7 commits into from
Jan 26, 2025
Merged
Changes from 1 commit
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
41 changes: 41 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy to Clever Cloud

on:
pull_request_target:
types: [opened, synchronize, reopened]
branches: [ main ]
workflow_dispatch: # Allow manual triggering for either environment

jobs:
staging:
if: github.event_name == 'pull_request' || github.event.action == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Clever Tools CLI
run: |
CC_VERSION=latest
curl -s -O https://clever-tools.clever-cloud.com/releases/${CC_VERSION}/clever-tools-${CC_VERSION}_linux.tar.gz
tar -xvf clever-tools-${CC_VERSION}_linux.tar.gz
PATH=${PATH}:$(pwd)/clever-tools-${CC_VERSION}_linux

- name: Login to Clever Cloud
env:
CLEVER_TOKEN: ${{ secrets.CLEVER_TOKEN }}
run: clever login --token ${{ secrets.CLEVER_TOKEN }} --secret ${{ secrets.CLEVER_SECRET }}

- name: Deploy backend to Clever Cloud (Staging)
env:
CLEVER_APP_ID: ${{ secrets.BE_CLEVER_APP_ID_STAGING }}
run: |
clever link $CLEVER_APP_ID
clever deploy

- name: Deploy frontend to Clever Cloud (Staging)
env:
CLEVER_APP_ID: ${{ secrets.FE_CLEVER_APP_ID_STAGING }}
run: |
clever link $CLEVER_APP_ID
clever deploy
Loading