-
Notifications
You must be signed in to change notification settings - Fork 259
104 lines (88 loc) · 3.35 KB
/
publish-to-dockerhub.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# 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 }}