-
Notifications
You must be signed in to change notification settings - Fork 195
44 lines (39 loc) · 1.46 KB
/
docker-publish.yml
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
name: Publish Packages to Docker Hub if Necessary
on:
push:
branches:
- develop
- production
paths:
- 'packages/hop-node/**'
- 'packages/v2-explorer-backend/**'
env:
DOCKER_TAG: ${{ (github.ref_name == 'develop' && 'unstable') || (github.ref_name == 'production' && 'latest') }}
jobs:
publish-docker-hop-node:
runs-on: ubuntu-latest
strategy:
matrix:
package-name: ['hop-node', 'v2-explorer-backend']
steps:
- name: Checkout code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- name: Check versions
id: check-versions
uses: ./.github/actions/check-version
with:
package-name: ${{ matrix.package-name }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb
- name: Login to Docker Hub
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish Docker image
if: steps.check-versions.outputs.package-version-changed == 'true' || github.ref_name != 'production'
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0
with:
file: ./packages/${{ matrix.package-name }}/Dockerfile
tags: hopprotocol/${{ matrix.package-name }}:${{ env.DOCKER_TAG }}
push: true