-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (43 loc) · 1.11 KB
/
build-images.yml
File metadata and controls
49 lines (43 loc) · 1.11 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
name: Docker Image CI for GHCR
on:
push:
branches:
- main
tags:
- v*
schedule:
- cron: "7 23 * * *"
workflow_dispatch:
env:
REGISTRY: ghcr.io
jobs:
build_and_publish:
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
matrix:
image: [cudesch]
steps:
- uses: actions/checkout@v5
- name: Login to registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata for the Docker image
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}-${{ matrix.image }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ${{ matrix.image }}
push: true
tags: ${{ steps.meta.outputs.tags }}