Merge pull request 'development' (#1) from development into main
All checks were successful
Website Sync / website-sync (push) Successful in 11s
All checks were successful
Website Sync / website-sync (push) Successful in 11s
Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
@@ -7,9 +7,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup SSH agent and deploy
|
- name: Setup SSH agent and deploy to web
|
||||||
|
if: GITEA.REF_NAME == 'main'
|
||||||
run: |
|
run: |
|
||||||
eval "$(ssh-agent -s)"
|
eval "$(ssh-agent -s)"
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
@@ -23,4 +24,21 @@ jobs:
|
|||||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
SSH_USER: ${{ secrets.SSH_USER }}
|
SSH_USER: ${{ secrets.SSH_USER }}
|
||||||
SSH_HOST: ${{ secrets.SSH_HOST }}
|
SSH_HOST: ${{ secrets.SSH_HOST }}
|
||||||
SSH_WEBSITE_LOCATION: ${{ secrets.SSH_WEBSITE_LOCATION }}
|
SSH_WEBSITE_LOCATION: ${{ secrets.SSH_WEBSITE_LOCATION }}
|
||||||
|
|
||||||
|
- name: Setup SSH agent and deploy to development
|
||||||
|
if: GITEA.REF_NAME == 'development'
|
||||||
|
run: |
|
||||||
|
eval "$(ssh-agent -s)"
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
||||||
|
chmod 700 ~/.ssh
|
||||||
|
ssh-keyscan "$SSH_HOST" >> ~/.ssh/known_hosts
|
||||||
|
chmod 644 ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
ssh "$SSH_USER@$SSH_HOST" "cd $SSH_WEBSITE_LOCATION && git stash && git pull --force origin development"
|
||||||
|
env:
|
||||||
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
SSH_USER: ${{ secrets.SSH_USER }}
|
||||||
|
SSH_HOST: ${{ secrets.SSH_HOST }}
|
||||||
|
SSH_WEBSITE_LOCATION: ${{ secrets.SSH_WEBSITE_LOCATION_DEVELOPMENT }}
|
||||||
Reference in New Issue
Block a user