Skip to content

Deploy Explorer

Deploy Explorer #28

Workflow file for this run

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
version: 1.70.0
- name: Checkout Repository
uses: actions/checkout@v4
- name: Display Branch Name
env:
REF: ${{ github.ref_name }}
run: |
echo "Current Branch: ${REF}"
- name: Deploy to server
env:
HOST_NAME: ${{ vars.EXPLORER_HOST }}
USERNAME: ${{ vars.USERNAME }}
APP_DIR: ${{ vars.EXPLORER_DIRECTORY }}
SERVICE_NAME: ${{ vars.SERVICE_NAME }}
REF: ${{ github.ref_name }}
run: |
ssh -o "StrictHostKeyChecking=no" ${USERNAME}@${HOST_NAME} "
cd ${APP_DIR} &&
git fetch &&
git reset --hard HEAD &&
git clean -fd &&
git checkout ${REF} &&
git pull &&
sudo systemctl restart ${SERVICE_NAME}
"