-
Notifications
You must be signed in to change notification settings - Fork 520
58 lines (51 loc) · 1.87 KB
/
docker-windows.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
58
name: Garnet Docker images for Windows
on:
workflow_dispatch: # allow manual run
workflow_run:
workflows: ['Garnet .NET CI']
types: [completed]
branches: [main]
push:
tags: 'v*'
permissions:
contents: read
packages: write
jobs:
docker:
runs-on: windows-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name != 'workflow_run' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}-nanoserver-ltsc2022
tags: |
# generate Docker tags based on the following events/attributes
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
if: github.event_name != 'pull_request'
run: |
docker build -f Dockerfile.nanoserver `
--tag ${{ fromJSON(steps.meta.outputs.json).tags[0] }} `
--tag ${{ fromJSON(steps.meta.outputs.json).tags[1] }} `
--tag ${{ fromJSON(steps.meta.outputs.json).tags[2] }} .
docker push ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
docker push ${{ fromJSON(steps.meta.outputs.json).tags[1] }}
docker push ${{ fromJSON(steps.meta.outputs.json).tags[2] }}