Skip to content

Docker Image CI

Docker Image CI #62

Workflow file for this run

name: Docker Image CI
on:
workflow_dispatch:
jobs:
build:
strategy:
matrix:
WIN_VER:
- 2022
- 2019
VS_VER:
- 2022
- 2019
- 2017
runs-on: windows-${{ matrix.WIN_VER }}
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull and tag parent image
run: |
docker pull ghcr.io/${{ github.repository_owner }}/chocolatey:ltsc${{ matrix.WIN_VER }}
docker tag ghcr.io/${{ github.repository_owner }}/chocolatey:ltsc${{ matrix.WIN_VER }} ${{ secrets.DOCKERHUB_USERNAME }}/chocolatey:ltsc${{ matrix.WIN_VER }}
- name: Build
run: >
docker build
--build-arg WIN_VER=ltsc${{ matrix.WIN_VER }} --build-arg VS_VER=${{ matrix.VS_VER }}
-t ${{ secrets.DOCKERHUB_USERNAME }}/visualstudio${{ matrix.VS_VER }}buildtools:ltsc${{ matrix.WIN_VER }}
-t ghcr.io/${{ github.repository_owner }}/visualstudio${{ matrix.VS_VER }}buildtools:ltsc${{ matrix.WIN_VER }}
.
- name: Tag latest
if: ${{matrix.WIN_VER == 2022 }}
run: |
docker tag ${{ secrets.DOCKERHUB_USERNAME }}/visualstudio${{ matrix.VS_VER }}buildtools:ltsc${{ matrix.WIN_VER }} ${{ secrets.DOCKERHUB_USERNAME }}/visualstudio${{ matrix.VS_VER }}buildtools
docker tag ghcr.io/${{ github.repository_owner }}/visualstudio${{ matrix.VS_VER }}buildtools:ltsc${{ matrix.WIN_VER }} ghcr.io/${{ github.repository_owner }}/visualstudio${{ matrix.VS_VER }}buildtools
- name: push
run: |
docker push ${{ secrets.DOCKERHUB_USERNAME }}/visualstudio${{ matrix.VS_VER }}buildtools --all-tags
docker push ghcr.io/${{ github.repository_owner }}/visualstudio${{ matrix.VS_VER }}buildtools --all-tags
trigger-next-workflow:
runs-on: ubuntu-latest
needs: build
steps:
- name: Trigger next workflow (visualstudio-workload-docker)
uses: benc-uk/workflow-dispatch@v1
with:
workflow: docker-image.yml
repo: ${{ github.repository_owner }}/visualstudio-workload-docker
token: ${{ secrets.VISUALSTUDIO_WORKLOAD_VCTOOLS_DOCKER }}