Some checks failed
Build and Deploy Frontend Learner / Build Frontend Learner Docker Image (push) Failing after 9s
Build and Deploy Frontend Learner / Deploy Frontend Learner to Server (push) Has been skipped
Build and Deploy Frontend Management / Build Frontend Management Docker Image (push) Failing after 9s
Build and Deploy Backend / Build Backend Docker Image (push) Failing after 9s
Build and Deploy Frontend Management / Deploy Frontend Management to Server (push) Has been skipped
Build and Deploy Backend / Deploy Backend to Server (push) Has been skipped
64 lines
1.9 KiB
YAML
64 lines
1.9 KiB
YAML
name: Build and Deploy Frontend Management
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- dev
|
|
paths:
|
|
- 'frontend_management/**'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
name: Build Frontend Management Docker Image
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Docker Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ vars.DOCKER_REGISTRY }}
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Extract metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ vars.DOCKER_REGISTRY }}/elearning-frontend-management
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=sha,prefix=
|
|
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./frontend_management
|
|
file: ./frontend_management/Dockerfile
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|
|
deploy:
|
|
name: Deploy Frontend Management to Server
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
|
|
steps:
|
|
- name: Remote Deploy
|
|
uses: appleboy/ssh-action@v1.2.1
|
|
with:
|
|
host: ${{ vars.SSH_DEPLOY_HOST }}
|
|
port: ${{ vars.SSH_DEPLOY_PORT }}
|
|
username: ${{ secrets.SSH_DEPLOY_USER }}
|
|
password: ${{ secrets.SSH_DEPLOY_PASSWORD }}
|
|
script: eval "${{ secrets.SSH_DEPLOY_FRONTEND_MGMT_CMD }}"
|