Skip to content

Deploy to Cloud Server #19

Deploy to Cloud Server

Deploy to Cloud Server #19

Workflow file for this run

name: Deploy to Cloud Server
on:
workflow_dispatch:
inputs:
service:
description: "Select the service to deploy"
required: true
type: choice
options:
- api
- user
- classroom
- course
- launch_screen
- paper
- academic
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Log in to Alibaba Cloud Docker Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.ALIYUN_DOCKER_REGISTRY }}
username: ${{ secrets.ALIYUN_DOCKER_USER }}
password: ${{ secrets.ALIYUN_DOCKER_PASSWORD }}
- name: Build and Push Docker Image
run: |
cd $GITHUB_WORKSPACE && bash ./hack/image-build-and-push.sh ${{ github.event.inputs.service }}
- name: SSH and deploy on server
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
script: |
cd ~/hack
bash docker-run.sh ${{ github.event.inputs.service }}