-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat-user-manage' of https://github.com/TeamVastsea/klp…
…bbs_survey_frontend into feat-user-manage
- Loading branch information
Showing
1 changed file
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,14 @@ name: CI/CD | |
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
branches: | ||
- "main" | ||
- "feat-user-manage" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_docker: | ||
name: Build docker | ||
name: Build Docker | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
|
@@ -29,11 +31,12 @@ jobs: | |
push: true | ||
platforms: linux/amd64 | ||
tags: | | ||
${{ secrets.DOCKERHUB_USERNAME }}/klpbbs-survey-frontend:latest | ||
${{ secrets.DOCKERHUB_USERNAME }}/klpbbs-survey-frontend:${{ github.ref == 'refs/heads/main' && 'latest' || 'user' }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
build_docker_acr: | ||
name: Build docker ACR | ||
name: Build Docker ACR | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
|
@@ -46,12 +49,14 @@ jobs: | |
password: "${{ secrets.REGISTRY_PASSWORD }}" | ||
- name: Build and push image | ||
run: | | ||
docker build -t registry.cn-guangzhou.aliyuncs.com/teamvastsea/klpbbs-survey-frontend:latest . | ||
docker push registry.cn-guangzhou.aliyuncs.com/teamvastsea/klpbbs-survey-frontend:latest | ||
docker build -t registry.cn-guangzhou.aliyuncs.com/teamvastsea/klpbbs-survey-frontend:${{ github.ref == 'refs/heads/main' && 'latest' || 'user' }} . | ||
docker push registry.cn-guangzhou.aliyuncs.com/teamvastsea/klpbbs-survey-frontend:${{ github.ref == 'refs/heads/main' && 'latest' || 'user' }} | ||
deploy: | ||
name: Deploy | ||
needs: [build_docker, build_docker_acr] | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' # Only run deploy if on main branch | ||
steps: | ||
- name: SSH To Host | ||
uses: appleboy/[email protected] | ||
|