dispatch deploy job #2
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: Harness Worker Image | |
| on: | |
| push: | |
| branches: [main, certification-worker] | |
| paths: | |
| - "Dockerfile" | |
| - "harness/**" | |
| - "src/**" | |
| - "pyproject.toml" | |
| - "poetry.lock" | |
| - ".github/workflows/harness-image.yml" | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/conductor-oss/python-sdk/harness-worker | |
| tags: | | |
| type=raw,value=latest | |
| type=raw,value=${{ github.event.release.tag_name }},enable=${{ github.event_name == 'release' }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| target: harness | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| dispatch-deploy: | |
| # TODO: remove the github.ref condition prior to merging | |
| if: github.event_name == 'release' || github.ref == 'refs/heads/certification-worker' | |
| needs: build-and-push | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: peter-evans/repository-dispatch@v3 | |
| with: | |
| token: ${{ secrets.CI_UTIL_DISPATCH_TOKEN }} | |
| repository: conductor-oss/oss-ci-util | |
| event-type: sdk_release | |
| client-payload: |- | |
| {"tag": "${{ github.event.release.tag_name || 'latest' }}", "repo": "${{ github.repository }}"} |