Skip to content

Commit

Permalink
Update dev.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob-in-son authored Aug 15, 2024
1 parent 7a005ee commit 8497ec6
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: bp-runner
defaults:
run:
working-directory: /var/www/aihomework/boilerplate
working-directory: /var/www/aihomework/boilerplate/dev

steps:
- name: Checkout code
Expand All @@ -28,22 +28,22 @@ jobs:
run: |
git remote rm action
# - name: Stash or remove local changes
# run: |
# if git diff --quiet; then
# echo "No local changes to stash."
# else
# echo "Stashing local changes..."
# git stash --include-untracked || echo "Failed to stash changes. Attempting to reset..."
# git reset --hard || exit 1
# fi
- name: Stash or remove local changes
run: |
if git diff --quiet; then
echo "No local changes to stash."
else
echo "Stashing local changes..."
git stash --include-untracked || echo "Failed to stash changes. Attempting to reset..."
git reset --hard || exit 1
fi
- name: Pull from GitHub
id: pull
run: |
remote_repo="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
# git remote add action $remote_repo
git clone $remote_repo staging
git remote add action $remote_repo
git pull $remote_repo dev
- name: Install dependencies
run: yarn install --frozen-lockfile
Expand All @@ -62,15 +62,15 @@ jobs:

- name: Setup and restart service
run: |
sudo cp server-script/aihomeworkstaging.service /etc/systemd/system
sudo cp server-script/aihomeworkdev.service /etc/systemd/system
sudo systemctl daemon-reload
sudo systemctl restart aihomeworkstaging.service
sudo systemctl restart aihomeworkdev.service
- name: Verify deployment
run: |
echo "Waiting for service to start..."
sleep 10
if sudo systemctl is-active --quiet aihomeworkstaging.service; then
if sudo systemctl is-active --quiet aihomeworkdev.service; then
echo "Deployment successful!"
else
echo "Deployment failed!"
Expand Down

0 comments on commit 8497ec6

Please sign in to comment.