-
Notifications
You must be signed in to change notification settings - Fork 0
/
content-web.yml
56 lines (49 loc) · 1.62 KB
/
content-web.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
name: content-web
# This workflow is triggered on push to the 'content-web' directory of the master branch of the repository
on:
push:
branches:
- master
paths:
- 'content-web/**'
# Configure workflow to also support triggering manually
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
# Environment variables are defined so that they can be used throughout the job definitions.
env:
imageRepository: 'content-web'
resourceGroupName: 'fabmedical-310671'
containerRegistryName]: 'acr310671'
containerRegistry: 'acr310671.azurecr.io'
dockerfilePath: './content-web'
tag: '${{ github.run_id }}'
# Jobs define the actions that take place when code is pushed to the master branch
jobs:
build-and-publish-docker-image:
name: Build and Push Docker Image
runs-on: ubuntu-latest
steps:
# Checkout the repo
- uses: actions/checkout@master
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to ACR
uses: docker/login-action@v1
with:
registry: ${{ env.containerRegistry }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- name: Build and push an image to container registry
uses: docker/build-push-action@v2
with:
context: ${{ env.dockerfilePath }}
file: "${{ env.dockerfilePath }}/Dockerfile"
pull: true
push: true
tags: |
${{ env.containerRegistry }}/${{ env.imageRepository }}:${{ env.tag }}
${{ env.containerRegistry }}/${{ env.imageRepository }}:latest