Docker Image CI #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * 0" | |
jobs: | |
build: | |
strategy: | |
matrix: | |
WIN_VER: ["2022", "2019"] | |
runs-on: windows-${{ matrix.WIN_VER }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build | |
run: | | |
$TAGS = "-t ${{ secrets.DOCKERHUB_USERNAME }}/chocolatey:ltsc${{ matrix.win_ver }}" | |
if ( ${{ strategy.job-index }} -eq 0 ) { $TAGS += " -t ${{ secrets.DOCKERHUB_USERNAME }}/chocolatey" } | |
cmd /c "docker build $TAGS --build-arg WIN_VER=ltsc${{ matrix.WIN_VER }} ." | |
- name: Push | |
run: docker push amitie10g/chocolatey --all-tags |