Skip to content

Commit

Permalink
lts work
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Downs <[email protected]>
  • Loading branch information
briandowns committed Feb 6, 2025
1 parent 038f7c1 commit d6a1377
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 4 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

permissions:
contents: read
id-token: write
security-events: write # upload Sarif results

name: Build
Expand All @@ -17,10 +18,26 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: "Read secrets"
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/github/release-app-credentials appId | APP_ID ;
secret/data/github/repo/${{ github.repository }}/github/release-app-credentials privateKey | PRIVATE_KEY
- name: Create App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
repositories: release-node-feature-discovery
app-id: ${{ env.APP_ID }}
private-key: ${{ env.PRIVATE_KEY }}

- name: Set the TAG value
id: get-TAG
run: |
echo "$(make -s log | grep TAG)" >> "$GITHUB_ENV"
- name: Build container image
uses: docker/build-push-action@v6
with:
Expand All @@ -30,6 +47,7 @@ jobs:
file: Dockerfile
build-args: |
TAG=${{ env.TAG }}
SRC=x-access-token:${{ steps.app-token.outputs.token }}@github.com/rancher/release-node-feature-discovery
- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
Expand All @@ -52,6 +70,21 @@ jobs:
- name: Check out code
uses: actions/checkout@v4

- name: "Read secrets"
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/github/release-app-credentials appId | APP_ID ;
secret/data/github/repo/${{ github.repository }}/github/release-app-credentials privateKey | PRIVATE_KEY
- name: Create App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
repositories: release-multus-cni
app-id: ${{ env.APP_ID }}
private-key: ${{ env.PRIVATE_KEY }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand All @@ -62,6 +95,7 @@ jobs:
id: get-TAG
run: |
echo "$(make -s log | grep TAG)" >> "$GITHUB_ENV"
- name: Build container image
uses: docker/build-push-action@v6
with:
Expand All @@ -73,3 +107,4 @@ jobs:
platforms: linux/arm64
build-args: |
TAG=${{ env.TAG }}
SRC=x-access-token:${{ steps.app-token.outputs.token }}@github.com/rancher/release-node-feature-discovery
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ jobs:
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials username | DOCKER_USERNAME ;
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials password | DOCKER_PASSWORD ;
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials registry | PRIME_REGISTRY ;
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials username | PRIME_REGISTRY_USERNAME ;
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials password | PRIME_REGISTRY_PASSWORD
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials password | PRIME_REGISTRY_PASSWORD ;
secret/data/github/repo/${{ github.repository }}/github/release-app-credentials appId | APP_ID ;
secret/data/github/repo/${{ github.repository }}/github/release-app-credentials privateKey | PRIVATE_KEY
- name: Build and push image
uses: rancher/ecm-distro-tools/actions/publish-image@master
env:
SRC: x-access-token:${{ steps.app-token.outputs.token }}@github.com/rancher/release-node-feature-discovery
with:
image: rancher/hardened-node-feature-discovery
tag: ${{ github.event.release.tag_name }}
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ RUN go-assert-boring.sh bin/*
# Build node feature discovery
ARG ARCH="amd64"
ARG TAG=v0.15.7
ARG SRC="github.com/rancher/release-node-feature-discovery"
ARG PKG="github.com/kubernetes-sigs/node-feature-discovery"
RUN git clone --depth=1 https://${PKG}.git $GOPATH/src/${PKG}
RUN git clone --depth=1 https://${SRC}.git $GOPATH/src/${PKG}
WORKDIR $GOPATH/src/${PKG}
RUN git fetch --all --tags --prune
RUN git checkout tags/${TAG} -b ${TAG}
Expand Down

0 comments on commit d6a1377

Please sign in to comment.