Добавить .gitea/workflows/action.yaml
All checks were successful
Deploy Wishlist / deploy (push) Successful in 43s
All checks were successful
Deploy Wishlist / deploy (push) Successful in 43s
This commit is contained in:
parent
b592c945e7
commit
93802ef916
|
@ -0,0 +1,44 @@
|
|||
name: Deploy Wishlist
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
env:
|
||||
DEPLOY_DIR: ${{ secrets.DEPLOY_DIR }}
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Create .env file from secrets
|
||||
run: |
|
||||
echo "$ENV_PROD" > .env
|
||||
if [ ! -s .env ]; then
|
||||
echo "Error: .env file is empty!"
|
||||
exit 1
|
||||
fi
|
||||
env:
|
||||
ENV_PROD: ${{ secrets.ENV_PROD }}
|
||||
|
||||
- name: Install PHP dependencies
|
||||
run: composer install
|
||||
|
||||
- name: Install Node.js dependencies
|
||||
run: npm i
|
||||
|
||||
- name: Build assets
|
||||
run: npm run build
|
||||
|
||||
- name: Copy files to deployment directory
|
||||
run: |
|
||||
chmod -R 777 ./
|
||||
sudo rsync -av ./ ${DEPLOY_DIR}/
|
||||
|
||||
- name: Restart PHP service
|
||||
run: sudo systemctl restart php8.2-fpm
|
||||
|
||||
- name: Restart Nginx
|
||||
run: sudo systemctl restart nginx
|
Loading…
Reference in New Issue