Skip to content

Commit

Permalink
chore: [ci skip] [test skip] move docker publish workflow to a separa…
Browse files Browse the repository at this point in the history
…te action (#314)
  • Loading branch information
dzhelezov committed Mar 11, 2021
1 parent 7a2537e commit 45096b1
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 27 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: docker-publish
on:
workflow_dispatch: # manually run
inputs:
packages:
description: 'Comma-separated list of packages to publish to Docker Hub'
required: true
default: '*'
graduate:
description: 'Graduate from prerelease'
required: false
default: 'false'



env:
CI: true

jobs:
publish:
name: docker-publish
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Docker login
if: "contains(github.event.inputs.packages, 'hydra-indexer') || github.event.inputs.packages == '*'"
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Docker build
if: "contains(github.event.inputs.packages, 'hydra-indexer') || github.event.inputs.packages == '*'"
run: |
docker build . -t hydra-builder:latest
- name: Publish hydra-indexer image
if: "contains(github.event.inputs.packages, 'hydra-indexer') || github.event.inputs.packages == '*'"
run: |
(cd ./packages/hydra-indexer && yarn docker:publish)
env:
RELEASE_TAG: ${{ github.event.inputs.graduate == 'true' && 'latest' || 'next' }}

- name: Publish hydra-indexer-gateway image
if: "contains(github.event.inputs.packages, 'hydra-indexer-gateway') || github.event.inputs.packages == '*'"
run: |
(cd ./packages/hydra-indexer-gateway && yarn docker:publish)
env:
RELEASE_TAG: ${{ github.event.inputs.graduate == 'true' && 'latest' || 'next' }}

27 changes: 0 additions & 27 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,3 @@ jobs:
if: github.event.inputs.graduate == 'false'
run: |
yarn lerna publish from-package --dist-tag next --yes --conventional-commits --conventional-prerelease '${{ github.event.inputs.packages }}'
- name: Docker login
if: "!contains(github.event.inputs.packages, 'hydra-indexer') || github.event.inputs.packages == '*'"
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Docker build
if: "contains(github.event.inputs.packages, 'hydra-indexer') || github.event.inputs.packages == '*'"
run: |
docker build . -t hydra-builder:latest
- name: Publish hydra-indexer image
if: "contains(github.event.inputs.packages, 'hydra-indexer') || github.event.inputs.packages == '*'"
run: |
(cd ./packages/hydra-indexer && yarn docker:publish)
env:
RELEASE_TAG: ${{ github.event.inputs.graduate == 'true' && 'latest' || 'next' }}

- name: Publish hydra-indexer-gateway image
if: "contains(github.event.inputs.packages, 'hydra-indexer-gateway') || github.event.inputs.packages == '*'"
run: |
(cd ./packages/hydra-indexer-gateway && yarn docker:publish)
env:
RELEASE_TAG: ${{ github.event.inputs.graduate == 'true' && 'latest' || 'next' }}

0 comments on commit 45096b1

Please sign in to comment.