Шел второй день страданий
Some checks are pending
Gitea Actions / Build and deploy (push) Waiting to run

This commit is contained in:
p.belezov 2024-03-13 15:37:01 +08:00
parent c39510d8c6
commit 4878285cde

View File

@ -5,24 +5,42 @@ on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu
name: Build and deploy
steps:
- run: cat "${{ vars.ENV_PROD }}" > .env
- run: echo "Stopping gitea service..."
- run: systemctl stop resume
- run: echo "Gitea service stopped"
- run: echo "Pulling repo..."
- name: Check out repository code
- 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
- run: echo "Repo pulled"
- run: echo "Updating npm dependencies..."
- run: pwd; node -v; npm i --progress=false;
- run: echo "NPM dependencies updated"
- run: echo "Updating composer dependencies..."
- run: pwd; export COMPOSER_ALLOW_SUPERUSER=1; composer show; composer update;
- run: echo "Composer dependencies updated"
- run: echo "Building frontend..."
- run: pwd; npm run build;
- run: echo "Frontend built"
- run: echo "Starting Gitea service"
- run: systemctl start resume
- run: echo "Gitea service started"
- 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