-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (53 loc) · 1.53 KB
/
container-image.yaml
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
name: "Build Container Image"
on:
push:
branches:
- master
tags:
- "*"
paths-ignore:
- "**/*.md"
- "LICENSE"
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install Dependencies
run: bash findAndReplaceMe
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata - Main
id: meta-main
uses: docker/metadata-action@v4
with:
images: ghcr.io/lzuba/mlaps-demo-server
tags: |
type=raw,value=snapshot,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=ref,event=branch
type=ref,event=pr
- name: Image - Main
uses: docker/build-push-action@v3
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64
file: docker/mlaps/mlaps.Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-main.outputs.tags }}
labels: ${{ steps.meta-main.outputs.labels }}