mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-10 00:11:15 +00:00
Adding github actions to build and push docker image
This commit is contained in:
parent
8d74f97713
commit
76a9564a6f
56
metadata-ingestion/.github/workflows/docker-frontend.yml
vendored
Normal file
56
metadata-ingestion/.github/workflows/docker-frontend.yml
vendored
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
name: datahub-ingest docker
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths-ignore:
|
||||||
|
- 'docs/**'
|
||||||
|
- '**.md'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- 'docker/**'
|
||||||
|
- '.github/workflows/docker-frontend.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/Dockerfile
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
repository: acryldata/designpartners
|
||||||
|
tags: ${{ needs.setup.outputs.tag }}
|
||||||
|
push: ${{ needs.setup.outputs.publish == 'true' }}
|
||||||
Loading…
x
Reference in New Issue
Block a user