Skip to content

fix(ci/docker-release): add roadrunner dependencies (#388) #17

fix(ci/docker-release): add roadrunner dependencies (#388)

fix(ci/docker-release): add roadrunner dependencies (#388) #17

name: Docker Release
on:
release:
types:
- published
push:
branches:
- dev
env:
IMAGE_REGISTRY: ghcr.io
IMAGE_PATH: ${{ github.repository }}
IMAGE_TAG: ${{ github.ref_name }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get latest release
id: latest_release
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: ${{ github.repository }}
excludes: prerelease, draft
- name: Docker Login
uses: docker/login-action@v2
with:
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push (latest release)
uses: docker/build-push-action@v4
if: ${{ github.event_name == 'release' && steps.latest_release.outputs.release == github.ref_name }} # run only on latest release
with:
push: true
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }}, ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:latest
- name: Build and push (release)
uses: docker/build-push-action@v4
if: ${{ github.event_name == 'release' && steps.latest_release.outputs.release != github.ref_name }} # run only on release (not latest)
with:
push: true
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }}
- name: Build and push (push)
uses: docker/build-push-action@v4
if: ${{ github.event_name == 'push' }} # run only on push (to dev)
with:
push: true
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }}