-
Notifications
You must be signed in to change notification settings - Fork 95
44 lines (37 loc) · 1.45 KB
/
docker.yaml
File metadata and controls
44 lines (37 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# 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