-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (46 loc) · 1.51 KB
/
release.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
name: Build Container
on:
workflow_dispatch:
env:
REGISTRY: ghcr.io
jobs:
build:
strategy:
matrix:
os:
- name: ubuntu-latest
docker: alpine
- name: windows-latest
docker: windows
runs-on: ${{ matrix.os.name }}
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- id: repo
uses: ASzc/change-string-case-action@v6
with:
string: ${{ github.event.repository.name }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ""
flavor: |
suffix=-${{ matrix.os.docker }}
tags: |
type=raw,value=latest
type=raw,value=stable,enable=${{ github.event_name == 'release' }}
type=semver,pattern={{version}},enable=${{ github.event_name == 'release' }}
type=sha,priority=250,enable=${{ github.event_name == 'workflow_dispatch' }}
- name: Build and push Docker image
uses: mr-smithers-excellent/docker-build-push@v6
with:
registry: ${{ env.REGISTRY }}
image: ${{ steps.repo.outputs.lowercase }}
dockerfile: Dockerfile.${{ matrix.os.docker }}
labels: ${{ join(fromJson(steps.meta.outputs.json).labels, ',') }}
tags: ${{ join(fromJson(steps.meta.outputs.json).tags, ',') }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}