Skip to content

refactor: unify cloud database entities with enterprise #579

refactor: unify cloud database entities with enterprise

refactor: unify cloud database entities with enterprise #579

Workflow file for this run

name: Automate Deploy
on:
workflow_dispatch:
pull_request:
types: [closed]
branches:
- main
merged: true
jobs:
Release:
if: contains(github.event.pull_request.labels.*.name, 'auto-deploy') || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Set RELEASE env var from package.json
run: echo RELEASE=$(node --print "require('./package.json').version") >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
build-args: |
ENVIRONMENT=cloud
platforms: |
linux/amd64
push: true
tags: |
ghcr.io/activepieces/activepieces-cloud:${{ env.RELEASE }}.${{ github.sha }}
- name: Configure SSH
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/ops.key
chmod 600 ~/.ssh/ops.key
cat >>~/.ssh/config <<END
Host ops
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/ops.key
StrictHostKeyChecking no
END
env:
SSH_USER: ${{ secrets.DEV_OPS_USERNAME }}
SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_HOST: ${{ secrets.DEV_OPS_HOST }}
- name: Deploy Web
run: |
ssh ops -t -t 'bash -ic "cd mrsk && kamal deploy --version ${{ env.RELEASE }}.${{ github.sha }} --config-file=config/web.yml --skip-push; exit"'
- name: Deploy Workers
run: |
ssh ops -t -t 'bash -ic "cd mrsk && kamal deploy --version ${{ env.RELEASE }}.${{ github.sha }} --config-file=config/workers.yml --skip-push; exit"'