Skip to content

Commit

Permalink
Merge branch 'feat-user-manage' of https://github.com/TeamVastsea/klp…
Browse files Browse the repository at this point in the history
…bbs_survey_frontend into feat-user-manage
  • Loading branch information
zrll12 committed Nov 2, 2024
2 parents 63eac3c + 2f8c5ba commit 5cfce3e
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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]
Expand Down

0 comments on commit 5cfce3e

Please sign in to comment.