2024-03-12 10:39:01 +03:00
|
|
|
name: Gitea Actions
|
2024-03-12 10:17:09 +03:00
|
|
|
run-name: ${{ gitea.actor }} is testing out Gitea Actions ??
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
Explore-Gitea-Actions:
|
2024-03-12 10:58:13 +03:00
|
|
|
runs-on: ubuntu
|
2024-03-13 10:37:01 +03:00
|
|
|
name: Build and deploy
|
2024-03-12 10:17:09 +03:00
|
|
|
steps:
|
2024-03-13 10:37:01 +03:00
|
|
|
- name: Migrate env file
|
|
|
|
run: cat ${{ secrets.ENV_PROD }} > .env
|
|
|
|
- name: Stop site service
|
|
|
|
run: systemctl stop resume
|
|
|
|
- name: Checkout code
|
2024-03-12 10:17:09 +03:00
|
|
|
uses: actions/checkout@v3
|
2024-03-13 10:37:01 +03:00
|
|
|
- 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
|