Skip to content

Docker (Windows)

Docker (Windows) #170

name: Docker (Windows)
on:
workflow_dispatch:
schedule:
- cron: '0 9 * * 3'
push:
branches: [ "master" ]
paths-ignore: [ "linux/**" ]
pull_request:
branches: [ "master" ]
env:
REGISTRY: ghcr.io
jobs:
build-windows:
runs-on: [windows-2022]
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: image_name
name: Make image name lowercase
uses: ASzc/change-string-case-action@v6
with:
string: ${{ github.repository }}
- name: Build Docker image
run: |
docker build . --pull --tag ${{ env.REGISTRY }}/${{ steps.image_name.outputs.lowercase }}:ltsc2022 --build-arg BASE=4.8.1-windowsservercore-ltsc2022 --build-arg ARIAL_TTF_URL=${{ secrets.ARIAL_TTF_URL }}
working-directory: windows
- name: Push Docker image
if: ${{ github.event_name != 'pull_request' }}
run: |
docker push ${{ env.REGISTRY }}/${{ steps.image_name.outputs.lowercase }}:ltsc2022
working-directory: windows
build-xamarin:
runs-on: [windows-2022]
needs: build-windows
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: image_name
name: Make image name lowercase
uses: ASzc/change-string-case-action@v6
with:
string: ${{ github.repository }}
- name: Build Docker image
run: |
docker build . -f xamarin.Dockerfile --pull --tag ${{ env.REGISTRY }}/${{ steps.image_name.outputs.lowercase }}:ltsc2022-xamarin --build-arg BASE=ltsc2022
working-directory: windows
- name: Push Docker image
if: ${{ github.event_name != 'pull_request' }}
run: |
docker push ${{ env.REGISTRY }}/${{ steps.image_name.outputs.lowercase }}:ltsc2022-xamarin
working-directory: windows