Publish Feathr Docker image to DockerHub #331
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 Feathr Docker image to DockerHub | |
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/**' | |
jobs: | |
build_and_push_image_to_registry: | |
name: Push Docker 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 }} | |
# Deploy the docker container to the three test environments for feathr | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build_and_push_image_to_registry | |
steps: | |
- name: Deploy to Feathr Purview Registry Azure Web App | |
id: deploy-to-purview-webapp | |
uses: distributhor/[email protected] | |
env: | |
webhook_url: ${{ secrets.AZURE_WEBAPP_FEATHR_PURVIEW_REGISTRY_WEBHOOK }} | |
- name: Deploy to Feathr RBAC Registry Azure Web App | |
id: deploy-to-rbac-webapp | |
uses: distributhor/[email protected] | |
env: | |
webhook_url: ${{ secrets.AZURE_WEBAPP_FEATHR_RBAC_REGISTRY_WEBHOOK }} | |
- name: Deploy to Feathr SQL Registry Azure Web App | |
id: deploy-to-sql-webapp | |
uses: distributhor/[email protected] | |
env: | |
webhook_url: ${{ secrets.AZURE_WEBAPP_FEATHR_SQL_REGISTRY_WEBHOOK }} |