Deploying via ssh instead of the compose-ssh actions #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy api and client | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'client/**' | |
- 'api/**' | |
- '.github/workflows/deploy-api-client.yml' | |
- 'docker-compose.yaml' | |
workflow_dispatch: | |
permissions: | |
actions: write | |
checks: read | |
deployments: write | |
pull-requests: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
path: substrait-fiddle | |
- name: Copy files to remote repository | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.DEPLOY_HOST_DNS }} | |
username: ${{ secrets.DEPLOY_USERNAME }} | |
key: ${{ secrets.DEPLOY_SSH_KEY }} | |
rm: true | |
source: "substrait-fiddle/*" | |
target: ~/deployment | |
- name: Deploy the docker-compose | |
uses: appleboy/[email protected] | |
env: | |
VITE_SESSION_SECRET: ${{ secrets.VITE_SESSION_SECRET }} | |
with: | |
host: ${{ secrets.DEPLOY_HOST_DNS }} | |
username: ${{ secrets.DEPLOY_USERNAME }} | |
key: ${{ secrets.DEPLOY_SSH_KEY }} | |
envs: VITE_SESSION_SECRET | |
script: | | |
export VITE_SESSION_SECRET=$VITE_SESSION_SECRET | |
cd ~/deployment | |
docker-compose stop | |
docker-compose rm -f | |
docker-compose build --no-cache | |
docker-compose up -d |