mirror of
https://github.com/datahub-project/datahub.git
synced 2026-01-08 07:46:24 +00:00
* bug: Fix docker actions. We renamed directories in docker/ which broke the actions. Also try to refactor the action files a little so that we can run (but not publish) these images on pull requests that change the docker/ dir as an extra check. Note this only seems to be supported by the dockerhub plugin; the github plugin doesn't support this (so that will be an issue when we move to it only). * Drop extra pipes
71 lines
2.0 KiB
YAML
71 lines
2.0 KiB
YAML
name: datahub-gms docker
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
- '**.md'
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- 'docker/**'
|
|
- '.github/workflows/docker-gms.yml'
|
|
paths_ignore:
|
|
- '**.md'
|
|
- '**.env'
|
|
release:
|
|
types: [published, edited]
|
|
|
|
jobs:
|
|
setup:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
tag: ${{ steps.tag.outputs.tag }}
|
|
publish: ${{ steps.publish.outputs.publish }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- id: tag
|
|
run: |
|
|
echo "GITHUB_REF: $GITHUB_REF"
|
|
TAG=$(echo ${GITHUB_REF} | sed -e 's,refs/heads/master,latest,g' -e 's,refs/tags/,,g' -e 's,refs/pull/\([0-9]*\).*,pr\1,g')
|
|
echo "tag=$TAG"
|
|
echo "::set-output name=tag::$TAG"
|
|
- name: Check whether publishing enabled
|
|
id: publish
|
|
env:
|
|
ENABLE_PUBLISH: ${{ secrets.DOCKER_PASSWORD }}
|
|
run: |
|
|
echo "Enable publish: ${{ env.ENABLE_PUBLISH != '' }}"
|
|
echo "::set-output name=publish::${{ env.ENABLE_PUBLISH != '' }}"
|
|
build-and-publish-dockerhub:
|
|
runs-on: ubuntu-latest
|
|
needs: setup
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: docker/build-push-action@v1
|
|
env:
|
|
DOCKER_BUILDKIT: 1
|
|
with:
|
|
dockerfile: ./docker/datahub-gms/Dockerfile
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
repository: linkedin/datahub-gms
|
|
tags: ${{ needs.setup.outputs.tag }}
|
|
push: ${{ needs.setup.outputs.publish == 'true' }}
|
|
build-and-publish-github:
|
|
runs-on: ubuntu-latest
|
|
if: ${{ needs.setup.outputs.publish == 'true' }}
|
|
needs: setup
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: VaultVulp/gp-docker-action@1.1.6
|
|
env:
|
|
DOCKER_BUILDKIT: 1
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
dockerfile: ./docker/datahub-gms/Dockerfile
|
|
image-name: datahub-gms
|
|
image-tag: ${{ needs.setup.outputs.tag }}
|