mirror of
https://github.com/ysoftdevs/oauth-playground-server.git
synced 2026-03-30 05:51:58 +02:00
Update deploy.yml
This commit is contained in:
36
.github/workflows/deploy.yml
vendored
36
.github/workflows/deploy.yml
vendored
@@ -1 +1,37 @@
|
|||||||
|
name: Deploy
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
workflow_call:
|
||||||
|
secrets:
|
||||||
|
SSH_PRIVATE_KEY:
|
||||||
|
required: true
|
||||||
|
SSH_HOST:
|
||||||
|
required: true
|
||||||
|
SSH_USER:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
environment:
|
||||||
|
name: oauth-playground.online
|
||||||
|
url: https://sso.oauth-playground.online
|
||||||
|
steps:
|
||||||
|
- name: Install SSH Key
|
||||||
|
uses: shimataro/ssh-key-action@v2
|
||||||
|
with:
|
||||||
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
known_hosts: 'just-a-placeholder-so-we-dont-get-errors'
|
||||||
|
- name: Adding Known Hosts
|
||||||
|
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
|
||||||
|
- name: Download a Build Artifact
|
||||||
|
uses: actions/download-artifact@v3.0.2
|
||||||
|
with:
|
||||||
|
name: server
|
||||||
|
path: server/
|
||||||
|
- name: Stop service
|
||||||
|
run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "systemctl stop OAuthServer"
|
||||||
|
- name: Deploy with rsync
|
||||||
|
run: rsync -avz server/* ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/var/oauth-online-server
|
||||||
|
- name: Start service
|
||||||
|
run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "systemctl start OAuthServer"
|
||||||
|
|||||||
Reference in New Issue
Block a user