|
| 1 | +name: 'Publish Image' |
| 2 | +description: 'Publish releases in container image' |
| 3 | +inputs: |
| 4 | + dockerhub_username: |
| 5 | + description: "The user name of dockerhub" |
| 6 | + required: true |
| 7 | + dockerhub_token: |
| 8 | + description: "The token of dockerhub" |
| 9 | + required: true |
| 10 | + dockerhub_namespace: |
| 11 | + description: "The namespace of dockerhub" |
| 12 | + required: true |
| 13 | +runs: |
| 14 | + using: "composite" |
| 15 | + steps: |
| 16 | + - name: Set up Docker Buildx |
| 17 | + uses: docker/setup-buildx-action@v1 |
| 18 | + |
| 19 | + - name: Login to DockerHub |
| 20 | + uses: docker/login-action@v1 |
| 21 | + with: |
| 22 | + username: ${{ inputs.dockerhub_username }} |
| 23 | + password: ${{ inputs.dockerhub_token }} |
| 24 | + |
| 25 | + - uses: actions/download-artifact@v2 |
| 26 | + with: |
| 27 | + name: release-${{ github.sha }}-${{ matrix.config.os }}-${{ matrix.config.target }} |
| 28 | + path: ./target/release |
| 29 | + |
| 30 | + - name: Build and publish databend image |
| 31 | + id: docker_build |
| 32 | + uses: docker/build-push-action@v2 |
| 33 | + with: |
| 34 | + push: true |
| 35 | + tags: ${{ inputs.dockerhub_namespace }}/databend:master # assume latest tag is the latest release tag |
| 36 | + context: . |
| 37 | + file: ./docker/Dockerfile |
| 38 | + - name: Image digest |
| 39 | + shell: bash |
| 40 | + run: echo ${{ steps.docker_build.outputs.digest }} |
| 41 | + |
| 42 | + - name: Build and publish perf_tools images |
| 43 | + id: docker_build_perf |
| 44 | + uses: docker/build-push-action@v2 |
| 45 | + with: |
| 46 | + push: true |
| 47 | + tags: ${{ inputs.dockerhub_namespace }}/perf-tool:latest # assume latest tag is the latest release tag |
| 48 | + platforms: linux/amd64, linux/arm64 |
| 49 | + context: . |
| 50 | + file: ./docker/perf-tool/Dockerfile |
| 51 | + - name: Perf image digest |
| 52 | + shell: bash |
| 53 | + run: echo ${{ steps.docker_build_perf.outputs.digest }} && cat ./tests/perfs/perfs.yaml |
0 commit comments