add workflows

This commit is contained in:
Cedric Verstraeten
2024-09-30 21:45:47 +02:00
parent 23f484e045
commit 4fdcdbdce6
24 changed files with 12709 additions and 8173 deletions
+31
View File
@@ -0,0 +1,31 @@
name: Build pull request
on:
pull_request:
types: [opened, synchronize]
jobs:
build-pull-request:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: actions/setup-node@v1 #this installs node and npm for us
with:
node-version: "10.x"
# Build the Angular application to the dist folder
- name: Build Angular application
run: |
cd kerberos.ng
npm install
npm run build
# Build the Docker image with the latest tag and the release tag
- name: Build Docker image
run: |
docker build -t uugai/kerberos-documentation:latest .
+53
View File
@@ -0,0 +1,53 @@
name: Create a new release
on:
release:
types: [created]
workflow_dispatch:
inputs:
tag:
description: "Tag for the Docker image"
required: true
default: "test"
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Build the Docker image with the latest tag and the release tag
- name: Build and push Docker image with latest tag
uses: docker/build-push-action@v2
if: github.event.inputs.tag != 'test'
with:
context: .
push: true
tags: uugai/kerberos-documentation:latest
- name: Build and push Docker image with release tag
uses: docker/build-push-action@v2
if: github.event.inputs.tag != 'test'
with:
context: .
push: true
tags: uugai/kerberos-documentation:${{ github.event.inputs.tag || github.ref_name }}
# After we build the Docker image, we create a pull request to update the GitOps repository
# This will allow us to update the Helm chart with the new Docker image tag.
- name: Create GitOps Pull Request
uses: cedricve/gitops-pullrequest-action@master
with:
github-token: ${{ secrets.TOKEN }}
gitops-repo: "uug-ai/gitops"
gitops-file: "environments/staging/doc.kerberos.io/deployment.yaml"
gitops-pr-branch: "release-kerberos-documentation-${{ github.event.inputs.tag || github.ref_name }}"
gitops-key: ".spec.template.spec.containers[0].image"
gitops-value: "uugai/kerberos-documentation:${{ github.event.inputs.tag || github.ref_name }}"
commit-email: "gitops@uug.ai"
commit-name: "GitOps - UUG.AI"
commit-message: "A new release for Kerberos documentation - ${{ github.event.inputs.tag || github.ref_name }}"
-28
View File
@@ -1,28 +0,0 @@
name: Docker Production build
on:
push:
branches: [ master ]
jobs:
build-amd64:
runs-on: ubuntu-latest
strategy:
matrix:
architecture: [amd64]
steps:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Run Buildx
run: docker buildx build --platform linux/${{matrix.architecture}} -t kerberos/documentation:$(echo $GITHUB_SHA | cut -c1-7) --push .
-37
View File
@@ -1,37 +0,0 @@
name: github pages
on:
push:
branches:
- master
- develop
pull_request:
jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive # Fetch Hugo themes (true OR recursive)
fetch-depth: 1 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
extended: true
- name: Install npm packages
run: |
npm install # reads info from package.js
- name: Build
run: hugo --minify --environment production # uses default config/_default/* files + merges with config/production ones
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/move-to-hugo-doks'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
+19
View File
@@ -0,0 +1,19 @@
name: Autofill PR description
on: pull_request
jobs:
openai-pr-description:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Autofill PR description if empty using OpenAI
uses: cedricve/azureopenai-pr-description@master
with:
github_token: ${{ secrets.TOKEN }}
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
azure_openai_api_key: ${{ secrets.AZURE_OPENAI_API_KEY }}
azure_openai_endpoint: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
azure_openai_version: ${{ secrets.AZURE_OPENAI_VERSION }}
overwrite_description: true