New-site/.gitea/workflows/gitea-actions.yml
p.belezov 4878285cde
Some checks are pending
Gitea Actions / Build and deploy (push) Waiting to run
Шел второй день страданий
2024-03-13 15:37:01 +08:00

46 lines
1.4 KiB
YAML

name: Gitea Actions
run-name: ${{ gitea.actor }} is testing out Gitea Actions ??
on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu
name: Build and deploy
steps:
- name: Migrate env file
run: cat ${{ secrets.ENV_PROD }} > .env
- name: Stop site service
run: systemctl stop resume
- name: Checkout code
uses: actions/checkout@v3
- name: Install Composer
run: |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
php composer.phar install
php composer.phar dump-autoload
- name: Update npm dependencies
run: |
pwd
node -v
npm i --progress=false
- name: Update composer dependencies
run: |
pwd
export COMPOSER_ALLOW_SUPERUSER=1
composer show
composer install
- name: Build frontend
run: pwd; npm run build;
- name: Deploy to Server
uses: https://gitea.com/aquelle1/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY }}
ARGS: "-rlgoDzvc -i --delete"
SOURCE: "site/"
REMOTE_HOST: ${{ secrets.SSH_HOST }}
REMOTE_USER: ${{ secrets.SSH_USER }}
TARGET: ${{ secrets.SSH_DIR }}
- name: Start site service
run: systemctl start resume