Skip to content

Commit

Permalink
Split Windows/Linux docker workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
anarthal committed Mar 11, 2024
1 parent 1593da4 commit 252732b
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#

name: Build Docker images
name: Build Linux Docker images

on:
workflow_dispatch:
Expand All @@ -15,7 +15,7 @@ on:


jobs:
linux-images:
docker-linux:
strategy:
matrix:
include:
Expand Down Expand Up @@ -71,38 +71,3 @@ jobs:
build-args: ${{ matrix.build-args }}
platforms: ${{ matrix.platforms }}
tags: ghcr.io/anarthal-containers/${{ matrix.image }}:${{ github.sha }}, ghcr.io/anarthal-containers/${{ matrix.image }}:latest

windows-images:
strategy:
matrix:
include:
- { image: build-msvc14_1, base-image: "cppalliance/dronevs2017:1" }
- { image: build-msvc14_2, base-image: "cppalliance/dronevs2019:1" }
- { image: build-msvc14_3, base-image: "cppalliance/dronevs2022:1" }

permissions:
contents: read
packages: write

runs-on: windows-2019

defaults:
run:
shell: bash

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: anarthal-containers
password: ${{ secrets.ANARTHAL_CONTAINERS_TOKEN }}

- name: Build and push Docker image
run: |
FULL_IMAGE=ghcr.io/anarthal-containers/${{ matrix.image }}
docker build -f tools/docker/build-msvc.dockerfile --build-arg BASE_IMAGE=${{ matrix.base-image }} -t $FULL_IMAGE:$GITHUB_SHA -t $FULL_IMAGE:latest .
docker push $FULL_IMAGE --all-tags
51 changes: 51 additions & 0 deletions .github/workflows/docker-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#
# Copyright (c) 2019-2024 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#

name: Build Docker Windows images

on:
workflow_dispatch:
push:
paths:
- tools/docker/build-msvc.dockerfile


jobs:
docker-windows:
strategy:
matrix:
include:
- { image: build-msvc14_1, base-image: "cppalliance/dronevs2017:1" }
- { image: build-msvc14_2, base-image: "cppalliance/dronevs2019:1" }
- { image: build-msvc14_3, base-image: "cppalliance/dronevs2022:1" }

permissions:
contents: read
packages: write

runs-on: windows-2019

defaults:
run:
shell: bash

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: anarthal-containers
password: ${{ secrets.ANARTHAL_CONTAINERS_TOKEN }}

- name: Build and push Docker image
run: |
FULL_IMAGE=ghcr.io/anarthal-containers/${{ matrix.image }}
docker build -f tools/docker/build-msvc.dockerfile --build-arg BASE_IMAGE=${{ matrix.base-image }} -t $FULL_IMAGE:$GITHUB_SHA -t $FULL_IMAGE:latest .
docker push $FULL_IMAGE --all-tags

0 comments on commit 252732b

Please sign in to comment.