From 8c87747c2c9234e2fa9b8672dd06149ff4fc3f4c Mon Sep 17 00:00:00 2001 From: Mars Lan Date: Sun, 2 Aug 2020 14:25:02 -0700 Subject: [PATCH] build(docker): build & publish docker images to GitHub Packages Will kepp publishing to Docker Hub meanwhile until all Dockerfiles have been updated to point to GitHub. Fixes https://github.com/linkedin/datahub/issues/1548 --- .github/workflows/docker-frontend.yml | 8 ++++++++ .github/workflows/docker-gms.yml | 8 ++++++++ .github/workflows/docker-mae-consumer.yml | 8 ++++++++ .github/workflows/docker-mce-consumer.yml | 13 ++++++++++++- 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-frontend.yml b/.github/workflows/docker-frontend.yml index 1d8eae453a7c48..3cc9e93235e273 100644 --- a/.github/workflows/docker-frontend.yml +++ b/.github/workflows/docker-frontend.yml @@ -12,6 +12,8 @@ jobs: if: ${{ github.repository == 'linkedin/datahub' }} steps: - uses: actions/checkout@v2 + - uses: ypicard/get-branch-name-github-action@v1 + id: tag - uses: docker/build-push-action@v1 with: dockerfile: ./docker/frontend/Dockerfile @@ -19,3 +21,9 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} repository: linkedin/datahub-frontend tag_with_ref: true + - uses: VaultVulp/gp-docker-action@1.1.6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + dockerfile: ./docker/gms/Dockerfile + image-name: datahub-frontend + image-tag: ${{ steps.tag.outputs.tag }} \ No newline at end of file diff --git a/.github/workflows/docker-gms.yml b/.github/workflows/docker-gms.yml index 279c44b266b251..95ddf273885ac5 100644 --- a/.github/workflows/docker-gms.yml +++ b/.github/workflows/docker-gms.yml @@ -12,6 +12,8 @@ jobs: if: ${{ github.repository == 'linkedin/datahub' }} steps: - uses: actions/checkout@v2 + - uses: ypicard/get-branch-name-github-action@v1 + id: tag - uses: docker/build-push-action@v1 with: dockerfile: ./docker/gms/Dockerfile @@ -19,3 +21,9 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} repository: linkedin/datahub-gms tag_with_ref: true + - uses: VaultVulp/gp-docker-action@1.1.6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + dockerfile: ./docker/gms/Dockerfile + image-name: datahub-gms + image-tag: ${{ steps.tag.outputs.tag }} diff --git a/.github/workflows/docker-mae-consumer.yml b/.github/workflows/docker-mae-consumer.yml index b553d07a26422e..54d7d7e8dc6824 100644 --- a/.github/workflows/docker-mae-consumer.yml +++ b/.github/workflows/docker-mae-consumer.yml @@ -12,6 +12,8 @@ jobs: if: ${{ github.repository == 'linkedin/datahub' }} steps: - uses: actions/checkout@v2 + - uses: ypicard/get-branch-name-github-action@v1 + id: tag - uses: docker/build-push-action@v1 with: dockerfile: ./docker/mae-consumer/Dockerfile @@ -19,3 +21,9 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} repository: linkedin/datahub-mae-consumer tag_with_ref: true + - uses: VaultVulp/gp-docker-action@1.1.6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + dockerfile: ./docker/gms/Dockerfile + image-name: datahub-mae-consumer + image-tag: ${{ steps.tag.outputs.tag }} diff --git a/.github/workflows/docker-mce-consumer.yml b/.github/workflows/docker-mce-consumer.yml index b5e1450ede9b56..0bba6e6d7e12e5 100644 --- a/.github/workflows/docker-mce-consumer.yml +++ b/.github/workflows/docker-mce-consumer.yml @@ -9,9 +9,14 @@ on: jobs: build: runs-on: ubuntu-latest - if: ${{ github.repository == 'linkedin/datahub' }} +# if: ${{ github.repository == 'linkedin/datahub' }} steps: - uses: actions/checkout@v2 + - id: tag + run: | + TAG=$(echo ${GITHUB_REF} | sed -e 's/refs\/heads\/master/latest/g' | sed -e 's/refs\/tags\///g') + echo "tag=$TAG" + echo "::set-output name=tag::$TAG" - uses: docker/build-push-action@v1 with: dockerfile: ./docker/mce-consumer/Dockerfile @@ -19,3 +24,9 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} repository: linkedin/datahub-mce-consumer tag_with_ref: true + - uses: VaultVulp/gp-docker-action@1.1.6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + dockerfile: ./docker/gms/Dockerfile + image-name: datahub-mce-consumer + image-tag: ${{ steps.tag.outputs.tag }} \ No newline at end of file