-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (70 loc) · 2.32 KB
/
ci.yaml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: kube-nimble CI
on:
push:
tags:
- 'v0.*'
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ghcr.io/ivaltryek/kube-nimble
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set env vars
run: |
echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
echo "DATE=$(date --rfc-3339=seconds)" >> $GITHUB_ENV
echo "REVISION=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }} && docker version
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
tags: "${{env.IMAGE_NAME}}:${{env.TAG_NAME}}, ${{env.IMAGE_NAME}}:latest"
labels: |
org.opencontainers.image.licenses=Apache
org.opencontainers.image.created=${{env.DATE}}
org.opencontainers.image.revision=${{env.REVISION}}
org.opencontainers.image.source=https://github.com/ivaltryek/kube-nimble
org.opencontainers.image.title=kube-nimble
org.opencontainers.image.version=${{env.TAG_NAME}}
annotations: |
org.opencontainers.image.description=Rust based Kubernetes Operator to deploy K8s objects minimally.
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: cargo build
run: |
cargo build --release --all-features
- name: generate CRD spec
run: |
mkdir -p crdspec
chmod +x target/release/crdgen
target/release/crdgen > crdspec/nimble.ivaltryek.github.com.yaml
- name: Release
uses: softprops/action-gh-release@v1
with:
files: crdspec/*
draft: true
fail_on_unmatched_files: true