2024-02-17 18:35:50 +01:00
|
|
|
name: deploy to production
|
|
|
|
run-name: ${{ gitea.actor }} has pushed to production
|
2024-02-20 09:48:59 +01:00
|
|
|
|
2024-02-17 18:35:50 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2024-02-20 10:55:27 +01:00
|
|
|
- master
|
2024-02-17 18:35:50 +01:00
|
|
|
workflow_dispatch:
|
2024-02-20 09:48:59 +01:00
|
|
|
|
2024-02-17 18:35:50 +01:00
|
|
|
jobs:
|
|
|
|
deploy-frontend:
|
2024-02-17 20:48:14 +01:00
|
|
|
runs-on: ubuntu-latest
|
2024-02-17 18:35:50 +01:00
|
|
|
steps:
|
2024-02-20 11:10:50 +01:00
|
|
|
- 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
|
|
|
|
- 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 backend/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:api/
|
|
|
|
- name: restarting the backend
|
|
|
|
working-directory: ./backend
|
|
|
|
run: |
|
|
|
|
echo "${{ secrets.SSH_KEY }}" > key
|
|
|
|
chmod 0600 key
|
2024-02-26 16:30:57 +01:00
|
|
|
ssh -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key "docker-compose restart"
|
2024-02-26 15:24:47 +01:00
|
|
|
- run: echo "The backend has been deployed. running at https://clyde.herisson.ovh/api"
|