forked from metabase/metabase
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.28 KB
/
master.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
name: Build and Deploy to AKS
on:
push:
branches:
- master
# Environment variables available to all jobs and steps in this workflow
env:
IMAGE: metabase-custom-image
jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# Login to Azure
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_KEY }}
# Configure docker to use the azure command-line tool as a credential helper
- run: |-
az acr login --name aftersale
- run: |-
az aks get-credentials --resource-group aftersale --name prod-aftersale
# Build the Docker image
- name: Build
run: |-
docker build \
--tag "aftersale.azurecr.io/$IMAGE:$GITHUB_SHA" \
--build-arg GITHUB_SHA="$GITHUB_SHA" \
--build-arg GITHUB_REF="$GITHUB_REF" .
# Push the Docker image to Azure Container Registry
- name: Publish
run: |-
docker push "aftersale.azurecr.io/$IMAGE:$GITHUB_SHA"
# Tag image as latest as branch is master
- name: Tag Master
run: |-
docker tag aftersale.azurecr.io/$IMAGE:$GITHUB_SHA aftersale.azurecr.io/$IMAGE:master
docker push aftersale.azurecr.io/$IMAGE:master