1 name: Build Windows CI Container
11 - .github/workflows/build-ci-container-windows.yml
12 - '.github/workflows/containers/github-action-ci-windows/**'
17 - .github/workflows/build-ci-container-windows.yml
18 - '.github/workflows/containers/github-action-ci-windows/**'
21 build-ci-container-windows:
22 if: github.repository_owner == 'llvm'
25 container-name: ${{ steps.vars.outputs.container-name }}
26 container-name-tag: ${{ steps.vars.outputs.container-name-tag }}
27 container-filename: ${{ steps.vars.outputs.container-filename }}
30 uses: actions/checkout@v4
32 sparse-checkout: .github/workflows/containers/github-action-ci-windows
33 - name: Write Variables
36 $tag = [int64](Get-Date -UFormat %s)
37 $container_name="ghcr.io/$env:GITHUB_REPOSITORY_OWNER/ci-windows-2019"
38 echo "container-name=${container_name}" >> $env:GITHUB_OUTPUT
39 echo "container-name-tag=${container_name}:${tag}" >> $env:GITHUB_OUTPUT
40 echo "container-filename=ci-windows-${tag}.tar" >> $env:GITHUB_OUTPUT
41 - name: Build Container
42 working-directory: .github/workflows/containers/github-action-ci-windows
44 docker build -t ${{ steps.vars.outputs.container-name-tag }} .
45 - name: Save container image
47 docker save ${{ steps.vars.outputs.container-name-tag }} > ${{ steps.vars.outputs.container-filename }}
48 - name: Upload container image
49 uses: actions/upload-artifact@v4
52 path: ${{ steps.vars.outputs.container-filename }}
56 if: github.event_name == 'push'
58 - build-ci-container-windows
63 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65 - name: Download container
66 uses: actions/download-artifact@v4
69 - name: Push Container
71 docker load -i ${{ needs.build-ci-container-windows.outputs.container-filename }}
72 docker tag ${{ needs.build-ci-container-windows.outputs.container-name-tag }} ${{ needs.build-ci-container-windows.outputs.container-name }}:latest
73 docker login -u ${{ github.actor }} -p $env:GITHUB_TOKEN ghcr.io
74 docker push ${{ needs.build-ci-container-windows.outputs.container-name-tag }}
75 docker push ${{ needs.build-ci-container-windows.outputs.container-name }}:latest