Skip to content

Merge branch 'develop' of github.com:hop-protocol/hop into production #33

Merge branch 'develop' of github.com:hop-protocol/hop into production

Merge branch 'develop' of github.com:hop-protocol/hop into production #33

name: Publish Packages to Docker Hub
on:
push:
branches:
- develop
- production
paths:
- 'packages/hop-node/**'
- 'packages/v2-explorer-backend/**'
- 'packages/api/**'
- 'packages/explorer-backend/**'
- 'packages/stats-worker/**'
env:
DOCKER_TAG: ${{ (github.ref_name == 'develop' && 'unstable') || (github.ref_name == 'production' && 'latest') }}
jobs:
publish-docker:
runs-on: ubuntu-latest
strategy:
matrix:
package-name: ['hop-node', 'v2-explorer-backend', 'api', 'explorer-backend', 'stats-worker']
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 (${{ env.DOCKER_TAG }})
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