-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (29 loc) · 926 Bytes
/
Copy pathdeploy.yml
File metadata and controls
35 lines (29 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Sync And Deploy to Server
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy-to-server:
runs-on: ubuntu-latest
# 2. Reference the step output here.
# GitHub evaluates this at the end of the job, so the link will appear on success.
environment:
name: production
url: ${{ steps.get-url.outputs.url }}
steps:
# 1. Create a step to expose the secret safely as an output
- name: Set Environment URL
id: get-url
run: echo "url=${{ secrets.PRODUCTION_URL }}" >> $GITHUB_OUTPUT
- name: Checkout repository code
uses: actions/checkout@v3
- name: Run Remote Deployment Script
uses: appleboy/ssh-action@v1.0.1
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
/bin/bash /scripts/SignAI-SFS/deploy.sh