1
0
forked from PGL/Clyde
Clyde/.gitea/workflows/deploy.yaml

51 lines
1.8 KiB
YAML
Raw Normal View History

name: deploy to production
run-name: ${{ gitea.actor }} has pushed to production
on:
push:
branches:
2024-02-20 10:55:27 +01:00
- master
2024-02-27 17:16:01 +01:00
workflow_run:
workflows:
- Build and test backend
- Build and test frontend
types:
- completed
workflow_dispatch:
jobs:
2024-04-22 21:05:38 +02:00
# deploy-frontend:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v3
# working-directory: ./frontend
# - run: npm ci
# name: clean install
# working-directory: ./frontend
# - name: building
# working-directory: ./frontend
# run: npm run build
# - name: pushing to the server
# working-directory: ./frontend
# run: |
# echo "${{ secrets.SSH_KEY }}" > key
# chmod 0600 key
# scp -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key -r dist/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:
# - run: echo "The website has been deployed. visit https://clyde.herisson.ovh/"
2024-02-26 15:24:47 +01:00
deploy-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: pushing to the server
run: |
echo "${{ secrets.SSH_KEY }}" > key
chmod 0600 key
2024-02-26 18:25:41 +01:00
scp -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key -r * ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:api/
2024-02-26 15:24:47 +01:00
- name: restarting the backend
run: |
2024-04-22 21:38:50 +02:00
ssh -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'cd api/ && sed -i compose.yaml -e "s/8080:8080/4001:8080/" -e "s/8000:8080/4000:8080/" -e "23 i\ environment:\n - VITE_CLYDE_MODE=prod" && docker-compose up --force-recreate --build -d'
2024-02-26 15:24:47 +01:00
- run: echo "The backend has been deployed. running at https://clyde.herisson.ovh/api"