Skip to content

Commit 8bcb7f5

Browse files
Create release.yaml
1 parent ec6afa2 commit 8bcb7f5

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/release.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: release package
2+
3+
on:
4+
push:
5+
tags: [ 'v*.*.*' ]
6+
7+
defaults:
8+
run:
9+
shell: 'bash -Eeuo pipefail -x {0}'
10+
11+
env:
12+
REGISTRY: ghcr.io
13+
14+
jobs:
15+
generate-jobs:
16+
name: lxcfs
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
-
23+
name: customlimitrange-manager
24+
image: kubeservice-stack/customlimitrange-manager
25+
file: ./hack/build/Dockerfile
26+
platforms: linux/amd64,linux/arm64
27+
28+
steps:
29+
-
30+
name: Checkout
31+
uses: actions/checkout@v3
32+
- id: git-x
33+
run: |
34+
echo "::set-output name=git-version::$(git describe --tags --always)"
35+
- id: git-branch
36+
run: |
37+
echo "::set-output name=git-branch::$(echo ${GITHUB_REF##*/} | tr '[A-Z]' '[a-z]')"
38+
-
39+
name: Set up QEMU
40+
uses: docker/setup-qemu-action@v2
41+
-
42+
name: Set up Docker Buildx
43+
uses: docker/setup-buildx-action@v2
44+
- name: Log in to the Container registry
45+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
46+
with:
47+
registry: ${{ env.REGISTRY }}
48+
username: ${{ github.actor }}
49+
password: ${{ secrets.GITHUB_TOKEN }}
50+
-
51+
name: Build and push
52+
uses: docker/build-push-action@v3
53+
with:
54+
file: ${{ matrix.file }}
55+
platforms: ${{ matrix.platforms }}
56+
push: true
57+
tags: |
58+
${{ env.REGISTRY }}/${{ matrix.image }}:${{steps.git-branch.outputs.git-branch}}-${{steps.git-versions.outputs.git-version}}
59+
${{ env.REGISTRY }}/${{ matrix.image }}:latest
60+
- name: Test ${{ matrix.name }}
61+
run: |
62+
docker pull ${{ env.REGISTRY }}/${{ matrix.image}}:${{steps.git-branch.outputs.git-branch}}-${{steps.git-versions.outputs.git-version}}
63+
docker image inspect ${{ env.REGISTRY }}/${{ matrix.image}}:${{steps.git-branch.outputs.git-branch}}-${{steps.git-versions.outputs.git-version}}

0 commit comments

Comments
 (0)