UpdateCaprover build

This commit is contained in:
2025-09-07 16:58:50 +07:00
parent f564c3efbd
commit 9fa4843637

View File

@@ -1,12 +1,15 @@
name: Build & Deploy name: Build & Deploy Managing API
on: on:
push: push:
branches: [ "dev" ] branches: [ "dev" ]
pull_request: pull_request:
branches: [ "dev" ] branches: [ "dev" ]
jobs: jobs:
build-and-deploy: build-and-deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -14,7 +17,7 @@ jobs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Login to Container Registry - name: Login to GitHub Container Registry
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: ghcr.io registry: ghcr.io
@@ -22,30 +25,22 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Preset Image Name - name: Preset Image Name
run: echo "IMAGE_URL=$(echo ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:$(echo ${{ github.sha }} | cut -c1-7) | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV run: echo "IMAGE_URL=$(echo ghcr.io/${{ github.repository_owner }}/managing-api:$(echo ${{ github.sha }} | cut -c1-7) | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
# - name: Build and push Docker Image - name: Build and push Docker Image
# uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
# with: with:
# context: ./src/Managing.WebApp context: .
# file: ./src/Managing.WebApp/Dockerfile-web-ui-dev file: ./src/Dockerfile-managing-api-dev
# push: true push: true
# tags: ${{ env.IMAGE_URL }} tags: |
${{ env.IMAGE_URL }}
ghcr.io/${{ github.repository_owner }}/managing-api:latest
- name: Deploy Image to CapRover
# - name: Create deploy.tar uses: caprover/deploy-from-github@v1.1.2
# uses: a7ul/tar-action@v1.1.0 with:
# with: server: "${{ secrets.CAPROVER_SERVER }}"
# command: c app: "${{ secrets.APP_NAME }}"
# cwd: "./" token: "${{ secrets.APP_TOKEN }}"
# files: | image: ${{ env.IMAGE_URL }}
# scripts/build_and_run.sh
# captain-definition
# outPath: deploy.tar
# - name: Deploy App to CapRover
# uses: caprover/deploy-from-github@v1.0.1
# with:
# server: '${{ secrets.CAPROVER_SERVER }}'
# app: '${{ secrets.APP_NAME }}'
# token: '${{ secrets.MANAGING_APPS }}'
#