Skip to content

Commit

Permalink
Merge branch 'main' of github.com:daotl/web-monorepo-starter
Browse files Browse the repository at this point in the history
  • Loading branch information
zwj-cheer committed Dec 8, 2023
2 parents 21ab09b + 35c788d commit 0f83898
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,32 @@ snippets:
echo proj=$proj >> $GITHUB_OUTPUT
docker_image=daotl/web-monorepo-starter-${proj}
echo docker_image=$docker_image >> $GITHUB_OUTPUT
echo commit_id_image=$docker_image:commit-${{ steps.commonVars.outputs.commid_id_8 }}
sleep 1000
if [[ ${{ needs.build.outputs.affectedProjs }} =~ (^|,)${proj}($|,) ]]; then
affected = true
else
affected =
fi
echo commit_id_image=$docker_image:commit-${{ steps.commonVars.outputs.commit_id_8 }}
affected=$(
bash << EOF
if [[ ${{ needs.build.outputs.affectedProjs }} =~ (^|,)${proj}($|,) ]]; then
echo true
else
echo false
fi
EOF
)
echo affected=$affected >> $GITHUB_OUTPUT
step-docker-setup-buildx: &step-docker-setup-buildx
uses: docker/setup-buildx-action@v3
if: ${{ steps.projectVars.affected }} == 'true' && github.ref == 'refs/heads/main' && github.event_name == 'push'
if: steps.projectVars.affected == 'true' && github.ref == 'refs/heads/main' && github.event_name == 'push'

step-docker-login: &step-docker-login
uses: docker/login-action@v3
if: ${{ steps.projectVars.affected }} == 'true' && github.ref == 'refs/heads/main' && github.event_name == 'push'
if: steps.projectVars.affected == 'true' && github.ref == 'refs/heads/main' && github.event_name == 'push'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

step-docker-build-push: &step-docker-build-push
uses: docker/build-push-action@v5
if: ${{ steps.projectVars.affected }} == 'true' && github.ref == 'refs/heads/main' && github.event_name == 'push'
if: steps.projectVars.affected == 'true' && github.ref == 'refs/heads/main' && github.event_name == 'push'
with:
context: apps/${{ github.job }}
file: apps/${{github.job}}/docker/Dockerfile.ci
Expand Down

0 comments on commit 0f83898

Please sign in to comment.