forked from pnp/powershell
-
Notifications
You must be signed in to change notification settings - Fork 1
158 lines (140 loc) · 5.7 KB
/
nightlydockerimages.yml
File metadata and controls
158 lines (140 loc) · 5.7 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Nightly Release to Docker Hub
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * *'
permissions: read-all
env:
IMAGE_NAME: ${{ secrets.DOCKER_ORG }}/powershell
jobs:
# Compute version once and share across jobs
compute-version:
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.v.outputs.VERSION }}
VERSION_NIGHTLY: ${{ steps.v.outputs.VERSION_NIGHTLY }}
steps:
- uses: actions/checkout@v4
- id: v
run: |
V="$(cat ./version.txt)"
echo "VERSION=$V" >> "$GITHUB_OUTPUT"
echo "VERSION_NIGHTLY=${V}-nightly" >> "$GITHUB_OUTPUT"
publish-docker-windows-amd64:
runs-on: windows-2025
needs: compute-version
steps:
- uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Avoids "no matching manifest ..." by pinning the arch-specific tag
- name: Pre-pull NanoServer base (amd64)
shell: pwsh
run: |
docker pull mcr.microsoft.com/windows/nanoserver:ltsc2025-amd64
- name: Build (Windows amd64)
shell: pwsh
run: |
$tag = "${{ env.IMAGE_NAME }}:${{ needs.compute-version.outputs.VERSION_NIGHTLY }}-windows-amd64"
# If your Dockerfile supports BASE_TAG, uncomment the two lines below and add `ARG BASE_TAG` in the Dockerfile:
# $env:BASE_TAG = "ltsc2025-amd64"
# docker build --build-arg BASE_TAG=$env:BASE_TAG --file ./docker/windows-amd64.dockerfile --tag $tag ./docker
docker build --file ./docker/windows-amd64.dockerfile --tag $tag ./docker
- name: Push (Windows amd64)
shell: pwsh
run: |
$tag = "${{ env.IMAGE_NAME }}:${{ needs.compute-version.outputs.VERSION_NIGHTLY }}-windows-amd64"
docker push $tag
publish-docker-linux-arm64:
runs-on: ubuntu-24.04-arm
needs: compute-version
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build & push (Linux arm64)
uses: docker/build-push-action@v6
with:
context: ./docker
file: ./docker/linux-arm64.dockerfile
platforms: linux/arm64/v8
push: true
tags: ${{ env.IMAGE_NAME }}:${{ needs.compute-version.outputs.VERSION_NIGHTLY }}-linux-arm64
publish-docker-linux-amd64:
runs-on: ubuntu-latest
needs: compute-version
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build & push (Linux amd64)
uses: docker/build-push-action@v6
with:
context: ./docker
file: ./docker/linux-amd64.dockerfile
platforms: linux/amd64
push: true
tags: ${{ env.IMAGE_NAME }}:${{ needs.compute-version.outputs.VERSION_NIGHTLY }}-linux-amd64
publish-docker-linux-arm32v7:
runs-on: ubuntu-latest
needs: compute-version
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
# Buildx v3 is fine; QEMU is preinstalled on GH-hosted Ubuntu runners
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build & push (Linux arm32/v7 - RPi2/Raspbian)
uses: docker/build-push-action@v6
with:
context: ./docker
file: ./docker/linux-arm32.dockerfile
platforms: linux/arm/v7
push: true
tags: ${{ env.IMAGE_NAME }}:${{ needs.compute-version.outputs.VERSION_NIGHTLY }}-linux-arm32v7
# Optional: pass your own build args
# build-args: |
# PNP_VERSION=${{ needs.compute-version.outputs.VERSION }}
publish-docker-manifest:
runs-on: ubuntu-latest
needs:
- compute-version
- publish-docker-linux-arm64
- publish-docker-linux-amd64
- publish-docker-linux-arm32v7
- publish-docker-windows-amd64
steps:
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Create multi-arch manifest (versioned)
run: |
docker buildx imagetools create \
-t ${{ env.IMAGE_NAME }}:${{ needs.compute-version.outputs.VERSION_NIGHTLY }} \
${{ env.IMAGE_NAME }}:${{ needs.compute-version.outputs.VERSION_NIGHTLY }}-linux-amd64 \
${{ env.IMAGE_NAME }}:${{ needs.compute-version.outputs.VERSION_NIGHTLY }}-linux-arm64 \
${{ env.IMAGE_NAME }}:${{ needs.compute-version.outputs.VERSION_NIGHTLY }}-linux-arm32v7 \
${{ env.IMAGE_NAME }}:${{ needs.compute-version.outputs.VERSION_NIGHTLY }}-windows-amd64
- name: Update 'nightly' tag
run: |
docker buildx imagetools create \
-t ${{ env.IMAGE_NAME }}:nightly \
${{ env.IMAGE_NAME }}:${{ needs.compute-version.outputs.VERSION_NIGHTLY }}-linux-amd64 \
${{ env.IMAGE_NAME }}:${{ needs.compute-version.outputs.VERSION_NIGHTLY }}-linux-arm64 \
${{ env.IMAGE_NAME }}:${{ needs.compute-version.outputs.VERSION_NIGHTLY }}-linux-arm32v7 \
${{ env.IMAGE_NAME }}:${{ needs.compute-version.outputs.VERSION_NIGHTLY }}-windows-amd64