-
Notifications
You must be signed in to change notification settings - Fork 123
53 lines (48 loc) · 2.14 KB
/
eventflow-logger.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
name: windows-eventflow-logger
on:
push:
branches: [ master ]
paths:
- hostprocess/eventflow-logger/VERSION
workflow_dispatch:
pull_request:
paths:
- hostprocess/eventflow-logger/**
branches:
- master
permissions:
contents: read
packages: write
jobs:
image:
runs-on: windows-2022
env:
image: ghcr.io/kubernetes-sigs/sig-windows/eventflow-logger
steps:
- uses: actions/checkout@v2
- name: set release image
run: |
$version=Get-Content "hostprocess\eventflow-logger\VERSION"
echo "RELEASE_IMAGE=${{ env.image }}:$version" >> $env:GITHUB_ENV
- name: login to GitHub container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: docker build
run: |
docker build -t ${{ env.RELEASE_IMAGE }}-1809 --build-arg=OS=1809 hostprocess\eventflow-logger
docker build -t ${{ env.RELEASE_IMAGE }}-ltsc2022 --build-arg=OS=ltsc2022 hostprocess\eventflow-logger
- name: docker push
if: ${{ github.event_name != 'pull_request' }}
run: |
docker push ${{ env.RELEASE_IMAGE }}-1809
docker push ${{ env.RELEASE_IMAGE }}-ltsc2022
docker manifest create --amend ${{ env.RELEASE_IMAGE }} ${{ env.RELEASE_IMAGE }}-1809
$osversion=(docker manifest inspect mcr.microsoft.com/windows/nanoserver:1809 -v | ConvertFrom-Json).Descriptor.platform."os.version"
docker manifest annotate --os windows --arch amd64 --os-version $osversion ${{ env.RELEASE_IMAGE }} ${{ env.RELEASE_IMAGE }}-1809
docker manifest create --amend ${{ env.RELEASE_IMAGE }} ${{ env.RELEASE_IMAGE }}-ltsc2022
$osversion=(docker manifest inspect mcr.microsoft.com/windows/nanoserver:ltsc2022 -v | ConvertFrom-Json).Descriptor.platform."os.version"
docker manifest annotate --os windows --arch amd64 --os-version $osversion ${{ env.RELEASE_IMAGE }} ${{ env.RELEASE_IMAGE }}-ltsc2022
docker manifest push --purge ${{ env.RELEASE_IMAGE }}