diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index cb19a0e..f0203d2 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -21,8 +21,22 @@ jobs: - name: Deploy container locally run: | - IMAGE=${{ secrets.DOCKER_HUB_USERNAME }}/control_deploy:latest + IMAGE=${{ secrets.DOCKER_HUB_USERNAME }}/control_dev:latest docker stop CONTROL_DEPLOY || true docker rm CONTROL_DEPLOY || true - docker run -d --name CONTROL_DEPLOY -p 8081:8081 $IMAGE + docker run -d --name CONTROL_DEPLOY -p 8083:8081 --restart=always \ + --add-host host.docker.internal:host-gateway \ + -e CORES="${{ secrets.CORES }}" \ + -e DB_USER="${{ secrets.DB_USER }}" \ + -e DB_PASSWORD="${{ secrets.DB_PASSWORD }}" \ + -e DB_HOST="${{ secrets.DB_HOST }}" \ + -e DB_NAME="${{ secrets.DB_NAME }}" \ + -e GUAC_DB_USER="${{ secrets.GUAC_DB_USER }}" \ + -e GUAC_DB_PASSWORD="${{ secrets.GUAC_DB_PASSWORD }}" \ + -e GUAC_DB_HOST="${{ secrets.GUAC_DB_HOST }}" \ + -e GUAC_DB_NAME="${{ secrets.GUAC_DB_NAME }}" \ + -e REDIS_HOST="${{ secrets.REDIS_HOST }}" \ + -e CMS_HOST="${{ secrets.CMS_HOST }}" \ + -e GUAC_BASE_URL="${{ secrets.GUAC_BASE_URL }}" \ + $IMAGE docker system prune -af diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml new file mode 100644 index 0000000..e179cb9 --- /dev/null +++ b/.github/workflows/pr-check.yaml @@ -0,0 +1,38 @@ +name: PR Build Verification + +on: + pull_request: + branches: + - Dev + +jobs: + build-check: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.23.x' + + - name: Download Go modules + run: go mod download + + - name: Build + run: go build -o main . + + - name: Comment on failure + if: failure() + uses: actions/github-script@v7 + with: + script: | + await github.rest.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + event: 'REQUEST_CHANGES', + body: 'Failed To BUILD! Please check the build logs for details.' + });