Skip to content

Commit

Permalink
Centralize build
Browse files Browse the repository at this point in the history
  • Loading branch information
sixeyed committed Jan 6, 2025
1 parent 4c70934 commit ee24218
Show file tree
Hide file tree
Showing 9 changed files with 202 additions and 166 deletions.
27 changes: 27 additions & 0 deletions .github/actions/push-manifests/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Push manifests'
description: 'Push manifest lists'
inputs:
images:
description: 'Push base image manifests'
required: false
default: 'true'
chapters:
description: 'Build chapter image manifests'
required: false
default: 'false'
filter:
description: 'Filter manifests to push'
required: false
default: ''
runs:
using: "composite"
steps:
- name: Push manifest lists
working-directory: build
shell: pwsh
run: |
./push-manifests.ps1
env:
BUILD_IMAGES: ${{ inputs.images }}
BUILD_CHAPTERS: ${{ inputs.chapters }}
FILTER: ${{ inputs.filter }}
139 changes: 139 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: Build

on:
push:
branches:
- "2e"
paths:
- "images/**"
- "build/**"
- ".github/workflows/build.yaml"

jobs:
images-linux-amd64:
runs-on: ubuntu-latest
steps:

- name: Registry login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- uses: actions/checkout@master

- uses: ./.github/actions/build

- uses: ./.github/actions/build
with:
images: 'false'
chapters: 'true'

images-windows-ltsc2019:
runs-on: windows-2019
steps:

- name: Docker Hub login
shell: pwsh
run: |
docker login -u $env:USER -p $env:TOKEN
env:
USER: ${{ secrets.DOCKER_HUB_USERNAME }}
TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Checkout
uses: actions/checkout@master

- name: Build Git Windows image
uses: ./.github/actions/build
with:
filter: 'git-windows'

- name: Build base images
uses: ./.github/actions/build

- name: Build chapter images
uses: ./.github/actions/build
with:
images: 'false'
chapters: 'true'

images-windows-ltsc2022:
runs-on: windows-2022
steps:

- name: Docker Hub login
shell: pwsh
run: |
docker login -u $env:USER -p $env:TOKEN
env:
USER: ${{ secrets.DOCKER_HUB_USERNAME }}
TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Checkout
uses: actions/checkout@master

- name: Build Git Windows image
uses: ./.github/actions/build
with:
filter: 'git-windows'

- name: Build base images
uses: ./.github/actions/build

- name: Build chapter images
uses: ./.github/actions/build
with:
images: 'false'
chapters: 'true'

images-windows-ltsc2025:
runs-on: windows-2025
steps:

- name: Docker Hub login
shell: pwsh
run: |
docker login -u $env:USER -p $env:TOKEN
env:
USER: ${{ secrets.DOCKER_HUB_USERNAME }}
TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Checkout
uses: actions/checkout@master

- name: Build Git Windows image
uses: ./.github/actions/build
with:
filter: 'git-windows'

- name: Build base images
uses: ./.github/actions/build

- name: Build chapter images
uses: ./.github/actions/build
with:
images: 'false'
chapters: 'true'

push-manifests:
if: ${{ always() }}
needs:
- images-linux-amd64
- images-windows-ltsc2019
- images-windows-ltsc2022
- images-windows-ltsc2025
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@master

- name: Push base image manifests
uses: ./.github/actions/push-manifests

- name: Push chapter image manifests
uses: ./.github/actions/push-manifests
with:
images: 'false'
chapters: 'true'

30 changes: 0 additions & 30 deletions .github/workflows/images-linux-amd64.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/images-windows-ltsc2019.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/images-windows-ltsc2022.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/images-windows-ltsc2025.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions .vscode/settings.json

This file was deleted.

4 changes: 2 additions & 2 deletions build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ try {

if ($Filter -and ($Filter -ne '')) {
docker compose $composeFiles build --pull $Filter
docker compose $composeFiles push $Filter
docker compose $composeFiles push -q $Filter
}
else {
docker compose $composeFiles build --pull
docker compose $composeFiles push
docker compose $composeFiles push -q
}
}

Expand Down
Loading

0 comments on commit ee24218

Please sign in to comment.