diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index 64d6ffc..a8c3c4a 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -2,7 +2,7 @@ name: Auto Approve on: workflow_run: - workflows: [Tests] + workflows: [Tests] types: [completed] jobs: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 36ccbc2..690c7a0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -65,7 +65,7 @@ jobs: runs-on: ubuntu-latest needs: - test - if: always() && needs.test.result == 'success' + if: always() && needs.test.result == 'success' && github.event_name == 'push' && github.ref == 'refs/heads/main' steps: - name: Checkout code uses: actions/checkout@v5 @@ -77,7 +77,9 @@ jobs: run: | git config user.name "GitHub Actions" git config user.email "actions@github.com" - git remote add gitlab https://gitlab.com/dk-raas/dkai/high-command/high-command-api.git || true + git remote remove gitlab 2>/dev/null || true + git remote add gitlab https://gitlab.com/dk-raas/dkai/high-command/high-command-api.git git config credential.helper '!f() { echo "username=oauth2"; echo "password=${GITLAB_TOKEN}"; }; f' - git fetch gitlab main || true - git push gitlab HEAD:main || echo "GitLab push failed" + git fetch gitlab main + git pull gitlab main --no-edit + git push gitlab HEAD:main diff --git a/docker-compose.yml b/docker-compose.yml index 2bddb0c..113cd8e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,12 @@ version: '3.8' services: api: - image: harbor.dataknife.net/library/high-command-api:latest + build: + context: . + dockerfile: Dockerfile + image: high-command-api:latest + # Alternative: Use Harbor image for production deployments + # image: harbor.dataknife.net/library/high-command-api:latest ports: - "5000:5000" environment: