-
Notifications
You must be signed in to change notification settings - Fork 364
50 lines (44 loc) · 1.43 KB
/
explorer.yml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: "Deploy Explorer"
on:
workflow_dispatch:
inputs:
environment:
type: environment
description: Select the environment
jobs:
Deploy:
name: Deploy Explorer to ${{ inputs.environment }}
runs-on: ubuntu-latest
environment:
name: ${{ inputs.environment }}
steps:
- name: Connect to Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
- name: Checkout Repository
uses: actions/checkout@v4
- name: Display Branch Name
env:
GITHUB_REF: ${{ github.ref }}
run: |
echo "Current Branch: ${GITHUB_REF}"
- name: Deploy to server
env:
HOST_NAME: ${{ vars.EXPLORER_HOST }}
USERNAME: ${{ vars.USERNAME }}
APP_DIR: ${{ vars.EXPLORER_DIRECTORY }}
SERVICE_NAME: ${{ vars.SERVICE_NAME }}
run: |
ssh -o StrictHostKeyChecking=no ${USER_NAME}@${HOST_NAME} "
cd ${APP_DIR} &&
echo 'Pulling latest changes' > test.txt "
# run: TODO uncomment this after testing connection
# ssh -o StrictHostKeyChecking=no ${USER_NAME}@${HOST_NAME} "
# cd ${APP_DIR} &&
# git fetch &&
# git checkout ${{ github.ref }} &&
# git pull &&
# sudo systemctl restart ${SERVICE_NAME} "