Merge pull request #101 from secretflow/renovate/tj-actions-changed-f… #106
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docker Image CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| image: tonistiigi/binfmt:qemu-v7.0.0-28 | |
| - name: Login to Dockerhub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Get all changed dockerfiles | |
| id: changed-docker-files | |
| uses: tj-actions/changed-files@v46 | |
| with: | |
| # Avoid using single or double quotes for multiline patterns | |
| files: | | |
| dockerfiles/*.DockerFile | |
| - name: Publish docker images | |
| run: | | |
| for file in ${{ steps.changed-docker-files.outputs.all_changed_files }}; do | |
| echo "$file was changed" | |
| ./publish_docker_image.py --file $file --tag $(date +%Y%m%d) | |
| done | |
| # - name: Build the Docker image | |
| # run: docker build . --file Dockerfile --tag my-image-name:$(date +%Y%m%d) | |