diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index 7e80349..c6fb287 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -1,6 +1,10 @@ name: Build and Push on: + pull_request: + branches: + - develop + - main push: branches: - develop @@ -22,7 +26,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 24 + node-version: 20 cache: npm - run: npm ci - run: npm run test @@ -30,6 +34,7 @@ jobs: publish_image: needs: test_build + if: github.event_name != 'pull_request' runs-on: ubuntu-latest timeout-minutes: 20 permissions: diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 1f8b30e..e9cc4d6 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -29,6 +29,7 @@ jobs: ( github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.event == 'push' && contains(fromJson('["develop","main"]'), github.event.workflow_run.head_branch) ) runs-on: ubuntu-latest diff --git a/docker-compose.yml b/docker-compose.yml index 61094fe..a365580 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,6 @@ services: app: - build: - context: . - dockerfile: Dockerfile + image: ${IMAGE_NAME:-ghcr.io/team-triple/triple_yjs}:${IMAGE_TAG:-develop} ports: - "1234:1234" environment: