Clyde/.gitea/workflows/deploy.yaml
Anthony Debucquoy 0015763523
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m16s
Build and test backend / Test-backend (push) Successful in 1m13s
deploy to production / deploy-frontend (push) Successful in 24s
deploy to production / deploy-backend (push) Failing after 1m21s
Build and test FrontEnd / Build-frontend (push) Successful in 22s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
.
2024-02-26 19:51:09 +01:00

52 lines
1.7 KiB
YAML

name: deploy to production
run-name: ${{ gitea.actor }} has pushed to production
on:
push:
branches:
- master
workflow_dispatch:
jobs:
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/"
deploy-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- uses: gradle/gradle-build-action@v3
- name: building
run: ./gradlew backend:build
- name: pushing to the server
run: |
echo "${{ secrets.SSH_KEY }}" > key
chmod 0600 key
scp -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key -r * ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:api/
- name: restarting the backend
run: |
ssh -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd backend && docker-compose restart"
- run: echo "The backend has been deployed. running at https://clyde.herisson.ovh/api"