Publish to Docker Hub #196
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow builds the docker container and publishes to dockerhub with appropriate tag | |
# It has two triggers, | |
# 1. daily i.e. runs everyday at specific time. | |
# 2. Anytime a new branch is created under releases | |
name: Publish to Docker Hub | |
on: | |
schedule: | |
# Runs daily at 10 PM UTC, would generate nightly tag | |
- cron: '00 22 * * *' | |
push: | |
# For every push against the releases/** branch, usually would happen at release time, Tag example - releases/v0.7.0 | |
branches: | |
- 'releases/**' | |
workflow_dispatch: | |
jobs: | |
build_and_push_feathr_registry_image: | |
name: Push Feathr registry image to Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: feathrfeaturestore/feathr-registry | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: FeathrRegistry.Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build_and_push_feathr_sandbox_image: | |
name: Push Feathr Sandbox image to Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: feathrfeaturestore/feathr-sandbox | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: FeathrSandbox.Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
# Trigger Azure Web App webhooks to pull the latest nightly image | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build_and_push_feathr_registry_image | |
steps: | |
- name: Deploy to Azure Web App feathr-registry-purview | |
id: deploy-to-feathr-registry-purview | |
uses: distributhor/workflow-webhook@v3.0.1 | |
env: | |
webhook_url: ${{ secrets.AZURE_WEBAPP_FEATHR_REGISTRY_PURVIEW_WEBHOOK }} | |
- name: Deploy to Azure Web App feathr-registry-purview-rbac | |
id: deploy-to-feathr-registry-purview-rbac | |
uses: distributhor/workflow-webhook@v3.0.1 | |
env: | |
webhook_url: ${{ secrets.AZURE_WEBAPP_FEATHR_REGISTRY_PURVIEW_RBAC_WEBHOOK }} | |
- name: Deploy to Azure Web App feathr-registry-sql | |
id: deploy-to-feathr-registry-sql | |
uses: distributhor/workflow-webhook@v3.0.1 | |
env: | |
webhook_url: ${{ secrets.AZURE_WEBAPP_FEATHR_REGISTRY_SQL_WEBHOOK }} | |
- name: Deploy to Azure Web App feathr-registry-sql-rbac | |
id: deploy-to-feathr-registry-sql-rbac | |
uses: distributhor/workflow-webhook@v3.0.1 | |
env: | |
webhook_url: ${{ secrets.AZURE_WEBAPP_FEATHR_REGISTRY_SQL_RBAC_WEBHOOK }} |