Шел второй день страданий
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: jobs:
Explore-Gitea-Actions: Explore-Gitea-Actions:
runs-on: ubuntu runs-on: ubuntu
name: Build and deploy
steps: steps:
- run: cat "${{ vars.ENV_PROD }}" > .env - name: Migrate env file
- run: echo "Stopping gitea service..." run: cat ${{ secrets.ENV_PROD }} > .env
- run: systemctl stop resume - name: Stop site service
- run: echo "Gitea service stopped" run: systemctl stop resume
- run: echo "Pulling repo..." - name: Checkout code
- name: Check out repository code
uses: actions/checkout@v3 uses: actions/checkout@v3
- run: echo "Repo pulled" - name: Install Composer
- run: echo "Updating npm dependencies..." run: |
- run: pwd; node -v; npm i --progress=false; php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- run: echo "NPM dependencies updated" php composer-setup.php
- run: echo "Updating composer dependencies..." php -r "unlink('composer-setup.php');"
- run: pwd; export COMPOSER_ALLOW_SUPERUSER=1; composer show; composer update; php composer.phar install
- run: echo "Composer dependencies updated" php composer.phar dump-autoload
- run: echo "Building frontend..." - name: Update npm dependencies
- run: pwd; npm run build; run: |
- run: echo "Frontend built" pwd
- run: echo "Starting Gitea service" node -v
- run: systemctl start resume npm i --progress=false
- run: echo "Gitea service started" - 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