deploy to server
This commit is contained in:
@@ -45,3 +45,26 @@ jobs:
|
||||
run: sed -i "s/{owner}/${{ vars.OWNER }}/g" pom.xml
|
||||
- name: Deploy to Gitea Packages
|
||||
run: mvn deploy
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: searchengine-artifact
|
||||
path: artifact
|
||||
- name: Install SSH Key
|
||||
uses: shimataro/ssh-key-action@v2
|
||||
with:
|
||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
- name: Deploy to Local Server
|
||||
run: scp -r artifact/* ${{ vars.DEPLOY_USER }}@${{ vars.DEPLOY_HOST }}:${{ vars.DEPLOY_PATH }}
|
||||
- name: Build and Run Docker Image with Docker Compose
|
||||
run: |
|
||||
ssh -T ${{ vars.DEPLOY_USER }}@${{ vars.DEPLOY_HOST }} << EOF
|
||||
cd ${{ vars.DEPLOY_PATH }}
|
||||
docker compose down
|
||||
docker compose up -d --build
|
||||
EOF
|
Reference in New Issue
Block a user