Workflow file for this run
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
| # This workflow is responsible for deploying a Docker image for a given | |
| # release to Docker Hub. It is triggered when a new release is created. This | |
| # job is separated from the publishing job, as it may fail independently and | |
| # we need to be able to retry it without re-running the publish step. | |
| name: docker | |
| on: | |
| release: | |
| types: | |
| - published | |
| workflow_dispatch: | |
| # Allow this workflow to be triggered manually | |
| jobs: | |
| deploy-image: | |
| # We want to trigger this job ONLY for a published release | |
| # related to the "ibm-openapi-validator" package. | |
| name: deploy-image | |
| if: "contains(github.ref_name, 'ibm-openapi-validator')" | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Display some info about the build for debugging purposes. | |
| - name: Trigger info | |
| run: | | |
| echo "Build triggered by event: " ${{ github.event_name }} | |
| echo " git ref: " ${{ github.ref }} | |
| echo " git ref_name: " ${{ github.ref_name }} | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # Node is used in the deployment script to extract the numeric version | |
| # from packages/validator/package.json. | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Build and deploy Docker image | |
| env: | |
| DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} | |
| run: ./scripts/deploy-container-image.sh |