Skip to content

Commit

Permalink
Merge branch 'main' into 65-auditing-and-analyzing-logins-and-logouts…
Browse files Browse the repository at this point in the history
…-with-functiongraph
  • Loading branch information
akyriako authored Dec 3, 2024
2 parents 24c0450 + 61d7221 commit 99361b4
Show file tree
Hide file tree
Showing 275 changed files with 10,157 additions and 2,319 deletions.
12 changes: 12 additions & 0 deletions .devcontainer/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# DOCS_NEXT
REACT_APP_VERSION=0.1-development
REACT_APP_DOCS_NEXT_HOST=docs-next.example.de
REACT_APP_DOCS_NEXT_ORG=akyriako

# DOCUSAURUS
REACT_APP_DOCUSAURUS_BASE_URL=/

# UMAMI
UMAMI_WEBSITE_ID=00000000-0000-0000-0000-000000000000
UMAMI_ANALYTICS_DOMAIN=localhost

9 changes: 7 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"yzhang.markdown-all-in-one",
"DavidAnson.vscode-markdownlint",
"redhat.vscode-yaml",
"TakumiI.markdowntable"
"TakumiI.markdowntable",
"Perkovec.emoji"
]
}
},
Expand All @@ -37,7 +38,11 @@
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm install"
"postCreateCommand": "npm install",

"runArgs": [
"--env-file", "${localWorkspaceFolder}/.devcontainer/.env"
]

// Configure tool-specific properties.
// "customizations": {},
Expand Down
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Admins must approve changes to docs-next repository
/docs/ @opentelekomcloud/ac-content-reviewer
42 changes: 42 additions & 0 deletions .github/workflows/automerge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: automerge

on:
pull_request:
types:
- labeled
- unlabeled
- synchronize
- opened
- edited
- ready_for_review
- reopened
- unlocked
pull_request_review:
types:
- submitted
check_suite:
types:
- completed
status: {}

jobs:
automerge:
runs-on: ubuntu-latest
if: >
contains(github.event.pull_request.labels.*.name, 'gate')
environment: github
steps:
- name: Create GitHub App Token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_KEY }}

- id: automerge
name: automerge
uses: pascalgn/automerge-action@v0.16.3
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
MERGE_LABELS: "gate"
MERGE_METHOD: "squash"
47 changes: 47 additions & 0 deletions .github/workflows/build-publish-ephemeral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Manage Pull Request Preview Instances

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed

concurrency: preview-${{ github.ref }}

jobs:
deploy-ephemeral-preview:
name: Deploy or Remove Ephemeral Preview
environment:
name: pull-requests-preview
url: 'https://${{ github.repository_owner }}.github.io${{ vars.DOCUSAURUS_BASE_URL }}pr-${{ github.event.pull_request.number }}'
runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get Commit Hash
id: commit_hash
uses: prompt/actions-commit-hash@v3

- name: Install and Build
if: github.event.action != 'closed'
env:
REACT_APP_VERSION: ${{ vars.APP_VERSION }}.PR${{ github.event.pull_request.number }}-${{ github.run_number }}-${{ steps.commit_hash.outputs.short }}-ephemeral
REACT_APP_DOCS_NEXT_HOST: ${{ vars.DOCS_NEXT_HOST }}
REACT_APP_DOCS_NEXT_ORG: ${{ vars.DOCS_NEXT_ORG }}
REACT_APP_DOCUSAURUS_BASE_URL: ${{ vars.DOCUSAURUS_BASE_URL }}pr-${{ github.event.pull_request.number }}
UMAMI_WEBSITE_ID: ${{ vars.UMAMI_WEBSITE_ID }}
UMAMI_ANALYTICS_DOMAIN: ${{ vars.UMAMI_ANALYTICS_DOMAIN }}
UMAMI_DATAHOST_URL: ${{ vars.UMAMI_DATAHOST_URL }}
UMAMI_DATA_DOMAIN: ${{ vars.UMAMI_DATA_DOMAINS }}
run: |
npm install
npm run build
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./build/
135 changes: 135 additions & 0 deletions .github/workflows/build-publish-production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: Build and Deploy Production Docker Images

on:
push:
tags:
- "v*.*.*"
workflow_dispatch:

jobs:
build-stable:
name: Build Production Artifacts
environment:
name: stable
runs-on: ubuntu-latest
outputs:
image_version: ${{ env.IMAGE_SEMVER }}
commit_hash: ${{ steps.export_commit_hash.outputs.commit_hash }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 'lts/*'

- name: Install NodeJS Dependencies
run: npm install

- name: Get Commit Hash
id: commit_hash
uses: prompt/actions-commit-hash@v3

- name: Build Version Tag
id: build_version_tag
run: echo "IMAGE_SEMVER=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Export Commit Hash
id: export_commit_hash
run: echo "commit_hash=${{ steps.commit_hash.outputs.short }}" >> $GITHUB_OUTPUT

- name: Build Container Image Metadata
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
${{ vars.REGISTRY }}/${{ vars.REGISTRY_ORG }}/${{ vars.IMG_NAME }}
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern=v{{major}}.{{minor}}.{{patch}}
type=raw,value=latest

- name: Build App
env:
REACT_APP_VERSION: ${{ env.IMAGE_SEMVER }}
REACT_APP_DOCS_NEXT_HOST: ${{ vars.DOCS_NEXT_HOST }}
REACT_APP_DOCS_NEXT_ORG: ${{ vars.DOCS_NEXT_ORG }}
REACT_APP_DOCUSAURUS_BASE_URL: ${{ vars.DOCUSAURUS_BASE_URL }}
REACT_APP_TYPESENSE_PROTOCOL: ${{ vars.TYPESENSE_PROTOCOL }}
REACT_APP_TYPESENSE_HOST: ${{ vars.TYPESENSE_HOST }}
REACT_APP_TYPESENSE_PORT: ${{ vars.TYPESENSE_PORT }}
REACT_APP_TYPESENSE_API_KEY: ${{ secrets.TYPESENSE_SEARCH_KEY }}
UMAMI_WEBSITE_ID: ${{ vars.UMAMI_WEBSITE_ID }}
UMAMI_ANALYTICS_DOMAIN: ${{ vars.UMAMI_ANALYTICS_DOMAIN }}
UMAMI_DATAHOST_URL: ${{ vars.UMAMI_DATAHOST_URL }}
UMAMI_DATA_DOMAIN: ${{ vars.UMAMI_DATA_DOMAINS }}
run: npm run build

- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ vars.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3.7.1

- name: Build and Push (Docker Image)
id: docker_build
uses: docker/build-push-action@v6.9.0
with:
context: ./
file: ./Dockerfile
provenance: false
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}

update-helm-charts:
needs: [build-stable]
environment: stable
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
# - name: Create GitHub App Token
# id: app-token
# uses: actions/create-github-app-token@v1
# with:
# app-id: ${{ secrets.APP_ID }}
# private-key: ${{ secrets.APP_KEY }}
- name: Checkout Charts Repo
uses: actions/checkout@v4
with:
repository: "${{ vars.DOCS_NEXT_CHARTS_ORG }}/${{ vars.DOCS_NEXT_CHARTS_REPO }}"
token: ${{ secrets.DOCS_NEXT_TOKEN }}
- name: Commit Changes
env:
image: ${{ vars.REGISTRY }}/${{ vars.REGISTRY_ORG }}/${{ vars.IMG_NAME }}
tag: ${{ needs.build-stable.outputs.image_version }}
run: |
git config --global user.name 'otcbot'
git config --global user.email 'otc_ecosystem_squad@t-systems.com'
sed -i 's|^version: .*|version: 0.3.${{github.run_number}}|' ./charts/docusaurus/Chart.yaml
sed -i 's|^appVersion: .*|appVersion: ${{ env.tag }}|' ./charts/docusaurus/Chart.yaml
sed -i 's|^tag: .*|tag: ${{ env.tag }}|' ./charts/docusaurus/values-prod.yaml
sed -i 's|^image: .*|image: ${{ env.image }}|' ./charts/docusaurus/values-prod.yaml
git commit -am "Automatic commit from GitHub Actions triggered by action ${{github.run_number}}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
env:
remote_pr_branch: 'release/production-${{ needs.build-stable.outputs.image_version }}'
with:
title: ${{ env.remote_pr_branch }}
token: ${{ secrets.DOCS_NEXT_TOKEN }}
branch: ${{ env.remote_pr_branch }}

Loading

0 comments on commit 99361b4

Please sign in to comment.