Skip to content

Docker Image CI

Docker Image CI #53

Workflow file for this run

name: Docker Image CI
on:
schedule:
- cron: '0 0 * */3 0'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
WIN_VER: ["2022", "2019"]
runs-on: windows-${{ matrix.WIN_VER }}
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: Build
run: >
docker build --build-arg WIN_VER=ltsc${{ matrix.WIN_VER }}
-t ${{ secrets.DOCKERHUB_USERNAME }}/chocolatey:ltsc${{ matrix.WIN_VER }}
-t ghcr.io/${{ github.repository_owner }}/chocolatey:ltsc${{ matrix.WIN_VER }}
.
- name: Tag latest
if: ${{ strategy.job-index == 0 }}
run: |
docker tag ${{ secrets.DOCKERHUB_USERNAME }}/chocolatey:ltsc${{ matrix.WIN_VER }} ${{ secrets.DOCKERHUB_USERNAME }}/chocolatey
docker tag ghcr.io/${{ github.repository_owner }}/chocolatey:ltsc${{ matrix.WIN_VER }} ghcr.io/${{ github.repository_owner }}/chocolatey
- name: push
run: |
docker push ${{ secrets.DOCKERHUB_USERNAME }}/chocolatey --all-tags
docker push ghcr.io/${{ github.repository_owner }}/chocolatey --all-tags
trigger-next-workflow:
runs-on: ubuntu-latest
needs: build
steps:
- name: Trigger next workflow (visualstudio-build-tools-docker)
uses: benc-uk/workflow-dispatch@v1
with:
workflow: docker-image.yml
repo: amitie10g/visualstudio-build-tools-docker
token: ${{ secrets.VISUALSTUDIO_BUILD_TOOLS_DOCKER }}