chore: improve deploy script

This commit is contained in:
kenjis 2024-05-17 21:39:38 +09:00
parent 8fc89854cc
commit a909c07f18
No known key found for this signature in database
GPG Key ID: BD254878922AF198
2 changed files with 9 additions and 4 deletions

View File

@ -5,8 +5,13 @@
# codeigniter4/userguide repo's master branch.
# See https://github.com/codeigniter4/userguide/blob/master/.github/workflows/deploy.yml
REPO=/opt/userguide
SITE=/home/public_html/userguides/userguide4
REPO="/opt/userguide"
SITE="/home/public_html/userguides/userguide4"
if [ "$(id -u)" = "0" ]; then
echo "Cannot be run as root. Please run as the user for deployment."
exit 1
fi
cd "$REPO"
git switch master

View File

@ -4,7 +4,7 @@ name: Deploy Production
on:
push:
branches:
branches:
- master
jobs:
@ -19,4 +19,4 @@ jobs:
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: /opt/userguide/.github/scripts/deploy
script: /opt/userguide/.github/scripts/deploy.sh