-
Notifications
You must be signed in to change notification settings - Fork 3
100 lines (94 loc) · 3.86 KB
/
docker-image.yml
File metadata and controls
100 lines (94 loc) · 3.86 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
name: Docker Image CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- tag: 2022
os: windows-2022
- tag: windows-2022
os: windows-2022
- tag: 2025
os: windows-2025
- tag: windows-2025
os: windows-2025
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
# Free disk space by removing pre-installed software we don't need
- name: Free disk space
run: |
Write-Host "Disk space before cleanup:"
Get-PSDrive C | Select-Object Used, Free | Format-Table
$paths = @(
'C:\Android',
'C:\Program Files\dotnet',
'C:\Program Files\MongoDB',
'C:\Program Files\PostgreSQL',
'C:\Selenium',
'C:\hostedtoolcache',
'C:\Program Files\Microsoft Visual Studio',
'C:\vcpkg',
'C:\Miniconda',
'C:\Program Files\Go',
'C:\Program Files\Node.js',
'C:\Program Files\Ruby',
'C:\Program Files\Java',
'C:\Program Files\Eclipse Adoptium'
)
foreach ($path in $paths) {
if (Test-Path $path) {
Write-Host "Removing $path ..."
Remove-Item -Recurse -Force $path -ErrorAction SilentlyContinue
}
}
docker system prune -a -f
Write-Host "Disk space after cleanup:"
Get-PSDrive C | Select-Object Used, Free | Format-Table
# Build Docker images
- name: Build webkitdev/base
run: docker build --tag webkitdev/base:${{ matrix.tag }} --file base/Dockerfile.${{ matrix.tag }} base
- name: Build webkitdev/scripts
run: docker build --tag webkitdev/scripts:${{ matrix.tag }} --build-arg IMAGE_TAG=${{ matrix.tag }} scripts
- name: Build webkitdev/scm
run: docker build --tag webkitdev/scm:${{ matrix.tag }} --build-arg IMAGE_TAG=${{ matrix.tag }} scm
- name: Build webkitdev/tools
run: docker build --tag webkitdev/tools:${{ matrix.tag }} --build-arg IMAGE_TAG=${{ matrix.tag }} tools
- name: Build webkitdev/msbuild-2022
run: docker build --tag webkitdev/msbuild-2022:${{ matrix.tag }} --build-arg IMAGE_TAG=${{ matrix.tag }} msbuild-2022
- name: Build webkitdev/buildbot-worker
run: docker build --tag webkitdev/buildbot-worker:${{ matrix.tag }} --build-arg IMAGE_TAG=${{ matrix.tag }} buildbot-worker
# Verify Docker image
- name: Verify webkitdev/buildbot-worker
run: docker run --rm webkitdev/buildbot-worker:${{ matrix.tag }} cmake --system-information
# Publish Docker images to DockerHub
- name: Dockerhub login
if: github.ref_name == github.event.repository.default_branch
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish webkitdev/base
if: github.ref_name == github.event.repository.default_branch
run: docker push webkitdev/base:${{ matrix.tag }}
- name: Publish webkitdev/scripts
if: github.ref_name == github.event.repository.default_branch
run: docker push webkitdev/scripts:${{ matrix.tag }}
- name: Publish webkitdev/scm
if: github.ref_name == github.event.repository.default_branch
run: docker push webkitdev/scm:${{ matrix.tag }}
- name: Publish webkitdev/tools
if: github.ref_name == github.event.repository.default_branch
run: docker push webkitdev/tools:${{ matrix.tag }}
- name: Publish webkitdev/msbuild-2022
if: github.ref_name == github.event.repository.default_branch
run: docker push webkitdev/msbuild-2022:${{ matrix.tag }}
- name: Publish webkitdev/buildbot-worker
if: github.ref_name == github.event.repository.default_branch
run: docker push webkitdev/buildbot-worker:${{ matrix.tag }}