-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (44 loc) · 1.56 KB
/
ci.yml
File metadata and controls
50 lines (44 loc) · 1.56 KB
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
name: ci
on:
workflow_dispatch:
# on push, we will run ci then also push built images
push:
branches:
- main
jobs:
ci-build-and-push:
name: ci-build-and-push
runs-on: ubuntu-latest
timeout-minutes: 35
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
# This enables the creation of a builder instance with persistent cache
driver-opts: |
image=moby/buildkit:latest
network=host
- name: Log in to Azure Container Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.AZURE_REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.AZURE_REGISTRY_USERNAME }}
password: ${{ secrets.AZURE_REGISTRY_PASSWORD }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ secrets.AZURE_REGISTRY_LOGIN_SERVER }}/topic_modeler:${{ github.sha }}
${{ secrets.AZURE_REGISTRY_LOGIN_SERVER }}/topic_modeler:latest
# Enhanced cache settings
cache-from: |
type=gha,scope=topic_modeler
type=registry,ref=${{ secrets.AZURE_REGISTRY_LOGIN_SERVER }}/topic_modeler:latest
cache-to: |
type=gha,scope=topic_modeler,mode=max
type=registry,ref=${{ secrets.AZURE_REGISTRY_LOGIN_SERVER }}/topic_modeler:latest,mode=max