39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
name: Deploy to production
|
|
run-name: ${{ gitea.actor }} is deploying to production
|
|
on: [push]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: localserver
|
|
steps:
|
|
- run: echo "The job was automatically triggered by a ${{ gitea.event_name }} event."
|
|
- run: echo "This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
|
- run: echo "The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
|
|
|
- name: Check out repository code
|
|
uses: https://gitea.com/ScMi1/checkout@v1
|
|
|
|
- name: Pull latest changes
|
|
run: |
|
|
git pull
|
|
git log -1 --format='%H'
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: Build
|
|
env:
|
|
VITE_DOMAIN_DEV: 'http://localhost:5000'
|
|
VITE_DOMAIN_PROD: 'https://sean.bet'
|
|
VITE_BASE_URL: 'trigger'
|
|
DB_HOST: 'localhost'
|
|
DB_USER: 'triggeradmin'
|
|
DB_PASS: '${{ secrets.DB_PASS }}'
|
|
run: |
|
|
export NODE_OPTIONS="--max_old_space_size=4096"
|
|
npm run build
|
|
|
|
- name: Move files
|
|
run: |
|
|
cp -r dist/* /home/magnum/TriggerFrontend/dist/
|
|
chown -R magnum:magnum /home/magnum/TriggerFrontend/dist |