Skip to content

Commit

Permalink
ci: 优化部署资源和修复镜像代理
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Jul 11, 2024
1 parent a6f28ee commit be78fc5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion deploy/gitea/.gitea/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
APP_NAME: ${{ github.event.repository.name }}
NAMESPACE: app
REGISTRY: ${{ secrets.DOCKER_REGISTRY && secrets.DOCKER_REGISTRY || 'docker.io' }}
REGISTRY_MIRROR: ${{ secrets.DOCKER_REGISTRY_MIRROR && secrets.DOCKER_REGISTRY_MIRROR || 'docker.io' }}
REPOSITORY: ${{ github.repository }}
GOPROXY: ${{ secrets.GOPROXY && secrets.GOPROXY || 'https://goproxy.cn,direct' }}
DOMAIN: ${{ secrets.DOMAIN || 'cago.org' }}
Expand Down Expand Up @@ -52,6 +53,9 @@ jobs:
- name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
uses: actions/setup-buildx-action@v3
with:
driver-opts: |
image=${{ env.REGISTRY_MIRROR }}/moby/buildkit:buildx-stable-1
- name: Login to Docker Hub
# uses: docker/login-action@v3
Expand Down Expand Up @@ -99,6 +103,7 @@ jobs:
RESOURCE_CPU: ${{ env.ENV=='prod' && '500m' || '100m' }}
RESOURCE_MEMORY: ${{ env.ENV=='prod' && '512Mi' || '128Mi' }}
AUTO_SCALING: ${{ env.ENV=='prod' && 'true' || 'false' }}
AUTO_SCALING_MIN_REPLICAS: ${{ env.ENV=='prod' && '2' || '1' }}
run: |
cd deploy/helm
helm upgrade --install \
Expand All @@ -110,4 +115,5 @@ jobs:
--set ingress.tls[0].hosts[0]=$DOMAIN \
--set resources.requests.cpu=$RESOURCE_CPU \
--set resources.requests.memory=$RESOURCE_MEMORY \
--set autoscaling.enabled=$AUTO_SCALING
--set autoscaling.enabled=$AUTO_SCALING \
--set autoscaling.minReplicas=$AUTO_SCALING_MIN_REPLICAS

0 comments on commit be78fc5

Please sign in to comment.