Skip to content

Commit

Permalink
ci: Independent frontend deployment file
Browse files Browse the repository at this point in the history
  • Loading branch information
Clashsoft committed Oct 24, 2023
1 parent 281aeb9 commit 87df7ce
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 28 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/deploy-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy Frontend

on:
push:
branches:
- master
tags:
- v*
paths:
- 'frontend/**'

jobs:
frontend:
name: Frontend
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # for git describe
- name: Set Deployment Options
id: deployment
run: ./.github/workflows/deploy.sh
- name: Build the Docker Image
uses: whoan/docker-build-with-cache-action@v6
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ${{ secrets.DOCKER_REGISTRY }}
image_name: fulib/fulib.org-frontend
image_tag: ${{ steps.deployment.outputs.tag }}
context: frontend/
- name: Deploy to Rancher
uses: sekassel-research/[email protected]
with:
rancher_url: ${{ secrets.RANCHER_URL }}
rancher_token: ${{ secrets.RANCHER_TOKEN }}
cluster_id: ${{ secrets.RANCHER_CLUSTER }}
project_id: ${{ secrets.RANCHER_PROJECT }}
namespace: ${{ secrets.NAMESPACE }}
deployment: fulib-frontend
docker_image: ${{ secrets.DOCKER_REGISTRY }}/fulib/fulib.org-frontend:${{ steps.deployment.outputs.tag }}
28 changes: 0 additions & 28 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,6 @@ jobs:
outputs:
version: ${{ steps.deployment.outputs.version }}
tag: ${{ steps.deployment.outputs.tag }}
frontend:
name: Frontend
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Deployment Options
id: deployment
run: ./.github/workflows/deploy.sh
- name: Build the Docker Image
uses: whoan/docker-build-with-cache-action@v6
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ${{ secrets.DOCKER_REGISTRY }}
image_name: fulib/fulib.org-frontend
image_tag: ${{ steps.deployment.outputs.tag }}
context: frontend/
- name: Deploy to Rancher
uses: sekassel-research/[email protected]
with:
rancher_url: ${{ secrets.RANCHER_URL }}
rancher_token: ${{ secrets.RANCHER_TOKEN }}
cluster_id: ${{ secrets.RANCHER_CLUSTER }}
project_id: ${{ secrets.RANCHER_PROJECT }}
namespace: ${{ secrets.NAMESPACE }}
deployment: fulib-frontend
docker_image: ${{ secrets.DOCKER_REGISTRY }}/fulib/fulib.org-frontend:${{ steps.deployment.outputs.tag }}
backend:
name: Backend
runs-on: ubuntu-latest
Expand Down

0 comments on commit 87df7ce

Please sign in to comment.