diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ea2693c..6dbf6165 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,9 @@ name: Build and push image on: - workflow_run: - workflows: ["Check code format"] - types: - - completed + pull_request: + branches: + - "main" push: branches: - main @@ -43,8 +42,24 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Test build + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v3 + with: + context: . + file: ./build/docker/agent/Dockerfile + load: true + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:test + cache-from: type=gha + cache-to: type=gha,mode=max + build-args: | + USERNAME=paf + USER_UID=1000 + USER_GID=1000 + - name: Build and push Docker image id: build + if: github.event_name != 'pull_request' uses: docker/build-push-action@v3 with: context: . diff --git a/.github/workflows/drive.yml b/.github/workflows/drive.yml index 989e40e8..b5f0cc9d 100644 --- a/.github/workflows/drive.yml +++ b/.github/workflows/drive.yml @@ -29,7 +29,6 @@ jobs: run: docker compose down -v # add rendered JSON as comment to the pull request - name: Add simulation results as comment - if: github.event_name == 'pull_request' uses: actions/github-script@v6 with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 5df7884a..561fc302 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,10 +1,12 @@ name: Check code format on: - workflow_run: - workflows: ["Linter markdown and code"] - types: - - completed + pull_request: + branches: + - "main" + push: + branches: + - main jobs: format: diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index eb3e25a4..05b1ff7d 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -4,6 +4,9 @@ on: pull_request: branches: - "main" + push: + branches: + - main jobs: linter: