chore: remove old GitHub Actions workflow
All checks were successful
Deploy Bot on NAS / deploy (push) Successful in 26s
All checks were successful
Deploy Bot on NAS / deploy (push) Successful in 26s
This commit is contained in:
parent
0c46ef5a81
commit
49ffd17528
1 changed files with 0 additions and 45 deletions
45
.github/workflows/deploy.yml
vendored
45
.github/workflows/deploy.yml
vendored
|
|
@ -1,45 +0,0 @@
|
|||
name: Deploy Bot on NAS
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, dev ]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Set deployment path
|
||||
id: set-path
|
||||
run: |
|
||||
if [ "${GITHUB_REF_NAME}" = "main" ]; then
|
||||
echo "DEPLOY_PATH=/share/CACHEDEV1_DATA/discord-bot-prod" >> $GITHUB_ENV
|
||||
elif [ "${GITHUB_REF_NAME}" = "dev" ]; then
|
||||
echo "DEPLOY_PATH=/share/CACHEDEV1_DATA/discord-bot-dev" >> $GITHUB_ENV
|
||||
else
|
||||
echo "Unsupported branch"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Update bot files
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
cd $DEPLOY_PATH
|
||||
git config --global --add safe.directory $DEPLOY_PATH
|
||||
|
||||
if [ ! -d ".git" ]; then
|
||||
git init
|
||||
git remote add origin https://x-access-token:$GITHUB_TOKEN@github.com/ArcElewyn/Discord.git
|
||||
else
|
||||
git remote remove origin || true
|
||||
git remote add origin https://x-access-token:$GITHUB_TOKEN@github.com/ArcElewyn/Discord.git
|
||||
fi
|
||||
|
||||
git fetch origin $GITHUB_REF_NAME
|
||||
git reset --hard origin/$GITHUB_REF_NAME
|
||||
|
||||
- name: Restart bot
|
||||
run: |
|
||||
cd $DEPLOY_PATH
|
||||
docker compose -f $DEPLOY_PATH/docker-compose.yml down || true
|
||||
docker compose -f $DEPLOY_PATH/docker-compose.yml up --build -d
|
||||
Loading…
Reference in a new issue