Stable release #27
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-License-Identifier: Apache-2.0 | |
# Copyright 2023 Authors of Nimbus | |
name: Stable release | |
on: | |
create: | |
tags: | |
- "v*" | |
permissions: read-all | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
release-nimbus-image: | |
if: github.repository == '5GSEC/nimbus' | |
name: Build and push nimbus image | |
uses: ./.github/workflows/release-image.yaml | |
with: | |
WORKING_DIRECTORY: . | |
NAME: nimbus | |
secrets: inherit | |
release-adapters-image: | |
if: github.repository == '5GSEC/nimbus' | |
strategy: | |
matrix: | |
adapters: [ "nimbus-kubearmor", "nimbus-netpol", "nimbus-kyverno" ] | |
name: Build and push ${{ matrix.adapters }} adapter's image | |
uses: ./.github/workflows/release-image.yaml | |
with: | |
WORKING_DIRECTORY: ./pkg/adapter/${{ matrix.adapters }} | |
NAME: ${{ matrix.adapters }} | |
secrets: inherit | |
update-image-tags-in-helm-charts: | |
if: github.repository == '5GSEC/nimbus' | |
needs: [ release-nimbus-image, release-adapters-image ] | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Get tag | |
id: tag | |
run: | | |
if [ ${{ github.ref }} == "refs/heads/main" ]; then | |
echo "tag=latest" >> $GITHUB_OUTPUT | |
else | |
echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
fi | |
- name: Update images tag | |
run: | | |
./scripts/update-image-tag.sh ${{ steps.tag.outputs.tag }} | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
branch: main | |
release_helm_charts: | |
if: github.repository == '5GSEC/nimbus' | |
needs: [ update-image-tags-in-helm-charts ] | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Install Helm | |
uses: azure/setup-helm@v4 | |
- name: Generate a token | |
id: generate-token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ vars.ACTIONS_APP_ID }} | |
private-key: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }} | |
repositories: charts | |
- name: Publish Helm chart | |
uses: stefanprodan/helm-gh-pages@master | |
with: | |
# Access token which can push to a different repo in the same org | |
token: ${{ steps.generate-token.outputs.token }} | |
charts_dir: deployments/ | |
# repo where charts would be published | |
owner: 5GSEC | |
repository: charts | |
branch: gh-pages | |
charts_url: https://5gsec.github.io/charts/ | |
commit_username: "github-actions[bot]" | |
commit_email: "github-actions[bot]@users.noreply.github.com" |