Skip to content

Commit dcd4b61

Browse files
committed
🔧 Fix staging-deploy action
1 parent 090255f commit dcd4b61

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

.github/workflows/staging.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@ jobs:
1616
- name: Set up SSH
1717
run: |
1818
mkdir -p ~/.ssh
19-
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
20-
chmod 600 ~/.ssh/id_ed25519
21-
ssh-keyscan -H ${{ secrets.LINODE_IP }} >> ~/.ssh/known_hosts
19+
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
20+
chmod 600 ~/.ssh/id_ed25519
21+
ssh-keyscan -H ${{ secrets.LINODE_IP }} >> ~/.ssh/known_hosts
2222
2323
- name: Deploy to Linode
2424
run: |
2525
ssh dev@${{ secrets.LINODE_IP }} << 'EOF'
26-
cd /var/www/portfolio-next
27-
git checkout staging && git pull origin staging
28-
pnpm install
29-
pnpm build
30-
pm2 restart next-staging || pm2 start pnpm --name "next-staging" -- run start
26+
cd /var/www/portfolio-next && \
27+
source ~/.profile && \
28+
git fetch origin && \
29+
git checkout staging && \
30+
git pull origin staging && \
31+
pnpm install && \
32+
pnpm build && \
33+
pm2 restart next-staging
3134
EOF

0 commit comments

Comments
 (0)