-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (39 loc) · 1.3 KB
/
build-and-publish.yaml
File metadata and controls
45 lines (39 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Build and push Docker image to GHCR
on:
push:
branches:
- master
schedule:
- cron: "0 0 * * 0" # Weekly on Sundays at midnight
jobs:
build-and-push:
runs-on: windows-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
autocrlf: false
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
id: push
shell: pwsh
run: |
$vectorVersion = "0.51.0"
docker build `
--build-arg WINDOWS_VERSION=ltsc2025 `
--build-arg VECTOR_VERSION=$vectorVersion `
-t ghcr.io/${{ github.repository_owner }}/vector-windows-container-image:latest `
-t ghcr.io/${{ github.repository_owner }}/vector-windows-container-image:v$vectorVersion `
.
docker push ghcr.io/${{ github.repository_owner }}/vector-windows-container-image:latest
docker push ghcr.io/${{ github.repository_owner }}/vector-windows-container-image:v$vectorVersion