Skip to content

Commit

Permalink
Add github workflow for production
Browse files Browse the repository at this point in the history
  • Loading branch information
osgsm committed Dec 24, 2024
1 parent 9d045ab commit d5d740a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on:
push:
branches:
- main
name: Deploy production
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Import ssh key
run: echo "$SSH_KEY" > key && chmod 600 key
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
- name: SSH & git pull
run: >
ssh -i key -p $PRODUCTION_PORT -o StrictHostKeyChecking=no
$PRODUCTION_USER@$PRODUCTION_HOST
"cd $PRODUCTION_PATH && git checkout main && git pull"
env:
PRODUCTION_USER: ${{ secrets.PRODUCTION_USER }}
PRODUCTION_HOST: ${{ secrets.PRODUCTION_HOST }}
PRODUCTION_PATH: ${{ secrets.PRODUCTION_PATH }}
PRODUCTION_PORT: ${{ secrets.PRODUCTION_PORT }}

0 comments on commit d5d740a

Please sign in to comment.