-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (53 loc) · 1.64 KB
/
deploy-on-acr.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
name: Build, use ACR deploy MkDocs pages
on:
workflow_dispatch:
env:
IMAGE_NAME: ask-me-pcturized
jobs:
# Build job
build:
name: Build Mkdocs pages and upload artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11.2'
# mkdocs build
- name: mkdocs build
run: |
pip install -r requirements.txt
cd readthedocs
mkdocs build -d _site
- uses: actions/upload-artifact@v3
with:
name: mkdocs-artifact
path: ${{ github.workspace }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
# Containerize job to azure container registry
containerize-azure-registry:
name: Publish image to Azure Container Registry
runs-on: ubuntu-latest
env:
REGISTRY: azurecr.io
needs: build
permissions:
pages: write
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: mkdocs-artifact
path: .
- uses: azure/docker-login@v1
name: Log in to the Container registry
with:
login-server: ${{ secrets.AZURE_REGISTRY_NAME}}.azurecr.io
username: ${{ secrets.AZURE_REGISTRY_USER}}
password: ${{ secrets.AZURE_REGISTRY_PASSWORD}}
- name: Deploy image
run: |
docker build . --file Dockerfile --tag ${{ secrets.AZURE_REGISTRY_USER}}.${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
docker push ${{ secrets.AZURE_REGISTRY_USER}}.${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}