Add GitHub Actions workflow for resource deployment
This commit is contained in:
25
.github/workflows/deploy-resources.yml
vendored
Normal file
25
.github/workflows/deploy-resources.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
name: Pull Code On Server
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "deploy-resources"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pull_code:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Pull latest code on server
|
||||||
|
uses: appleboy/ssh-action@v1
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.SERVER_IP }}
|
||||||
|
username: ${{ secrets.SERVER_USER }}
|
||||||
|
key: ${{ secrets.SERVER_SSH_KEY }}
|
||||||
|
script: |
|
||||||
|
cd /home/dilanka/my_website
|
||||||
|
git fetch --all
|
||||||
|
git reset --hard origin/deploy-resources
|
||||||
Reference in New Issue
Block a user