Skip to content

Commit

Permalink
ci(root): merge Docker build into the main nx affected step
Browse files Browse the repository at this point in the history
  • Loading branch information
NexZhu committed Dec 14, 2023
1 parent 563ffb2 commit c094c40
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ jobs:
# https://github.com/pnpm/pnpm/issues/6300#issuecomment-1722120409
run: CYPRESS_INSTALL_BINARY=0 ./scripts/pnpm-install-filtered.js --frozen-lockfile=true ${{ steps.affected.outputs.projs }}

- run: pnpm nx affected -t build lint

# Build Docker images

- uses: docker/setup-buildx-action@v3
id: docker-setup-buildx
if: github.ref == 'refs/heads/main' && github.event_name == 'push' && matrix.node-version == '20.x'
Expand All @@ -87,9 +83,13 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker images
if: github.ref == 'refs/heads/main' && github.event_name == 'push' && matrix.node-version == '20.x'
- name: nx affected
env:
INPUT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_BUILDER: ${{ steps.docker-setup-buildx.outputs.name }}
run: pnpm nx affected -t container -c ci
run: |
targets="build lint"
if [ ${{ github.ref }} = 'refs/heads/main' ] && [ ${{ github.event_name }} == 'push'] && [ ${{ matrix.node-version }} == '20.x']; then
targets="${targets} container"
fi
pnpm nx affected -t ${targets} -c ci

0 comments on commit c094c40

Please sign in to comment.