Skip to content

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

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

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

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') }}
# TODO: DRY
jobs:
check-modified-hop-node:
uses: ./.github/workflows/check-modified.yml
with:
package-name: hop-node
check-modified-v2-explorer-backend:
uses: ./.github/workflows/check-modified.yml
with:
package-name: v2-explorer-backend
publish-docker-hop-node:
needs: check-modified-hop-node
if: needs.check-modified-hop-node.outputs.npm-version-changed == 'true' || github.ref_name != 'production'
runs-on: ubuntu-latest
steps:
- 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
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0
with:
file: ./packages/hop-node/Dockerfile
tags: hopprotocol/hop-node:${{ env.DOCKER_TAG }}
push: true
publish-docker-v2-explorer-backend:
needs: check-modified-v2-explorer-backend
if: needs.check-modified-check-modified-v2-explorer-backend.outputs.npm-version-changed == 'true' || github.ref_name != 'production'
runs-on: ubuntu-latest
steps:
- 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
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0
with:
file: ./packages/v2-explorer-backend/Dockerfile
tags: hopprotocol/v2-explorer-backend:${{ env.DOCKER_TAG }}
push: true