Skip to content

Commit 0f7ffc8

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 0f7ffc8

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/images.yml

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

0 commit comments

Comments
 (0)