Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
fix(ci): trigger docker image publish on automatic releases (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
galargh authored Apr 24, 2023
1 parent 4909b8b commit 52a5a5c
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- 'main'
tags:
- 'v*'
workflow_run:
workflows: [Releaser]
types:
- completed

# we want images in main to always build in-order, so main-latest always points
# at the latest one but it is ok to build 'latest' and 'release' in parallel,
Expand All @@ -16,15 +20,37 @@ concurrency:
cancel-in-progress: false

jobs:
prepare_checkout:
if: (
github.repository == 'ipfs/bifrost-gateway'
|| github.event_name == 'workflow_dispatch'
) && (
github.event_name != 'workflow_run'
|| github.event.workflow_run.conclusion == 'success'
)
name: Decide what ref to check out
runs-on: ubuntu-latest
outputs:
ref: ${{ github.event_name != 'workflow_run' && github.ref || steps.releaser.outputs.version }}
steps:
- name: Inspect triggering Releaser workflow run
id: releaser
if: github.event_name == 'workflow_run'
uses: protocol/.github/.github/actions/inspect-releaser@master
with:
artifacts-url: github.event.workflow_run.artifacts_url
push_to_registry:
if: github.repository == 'ipfs/bifrost-gateway' || github.event_name == 'workflow_dispatch'
needs: [prepare_checkout]
if: needs.prepare_checkout.outputs.ref != ''
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
IMAGE_NAME: ipfs/bifrost-gateway
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
ref: ${{ needs.prepare_checkout.outputs.ref }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand Down

0 comments on commit 52a5a5c

Please sign in to comment.