Skip to content

Commit 4523e31

Browse files
committed
ci: add github workflow for publishing container images
Publishes container images of the reference plugins at ghcr.io/containerd/nri/plugins/<plugin>:<tag> The tag is the git tag name for tagged versions and "unstable" for the main branch.
1 parent be8b1e7 commit 4523e31

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/images.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish Container Images
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- v[0-9]+.[0-9]+.[0-9]+
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_REPO_BASE: ${{ env.REGISTRY}}/${{ github.repository }}
13+
14+
jobs:
15+
publish-images:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
packages: write
19+
contents: read
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Log in to registry
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ${{ env.REGISTRY }}
31+
username: ${{ github.repository_owner }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Build and push images
35+
run: |
36+
GITREF=${{ github.ref }}
37+
case $GITREF in
38+
refs/heads/main)
39+
VERSION=unstable
40+
;;
41+
*)
42+
;;
43+
esac
44+
45+
make plugin-images
46+
make plugin-images-push
47+

0 commit comments

Comments
 (0)