Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

97 short live environments for pr reviews #101

Merged
merged 11 commits into from
Sep 16, 2024
14 changes: 12 additions & 2 deletions .devcontainer/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
UMAMI_WEBSITE_ID="00000000-0000-0000-0000-000000000000"
UMAMI_ANALYTICS_DOMAIN="localhost"
# DOCS_NEXT
export REACT_APP_VERSION="0.1-development"
export REACT_APP_DOCS_NEXT_HOST="docs-next.example.de"
export REACT_APP_DOCS_NEXT_ORG="akyriako"

# DOCUSAURUS
export REACT_APP_DOCUSAURUS_BASE_URL="/"

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

40 changes: 40 additions & 0 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: pull-requests-preview-deployment

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

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

jobs:
deploy-preview:
environment: pull-requests-preview
runs-on: ubuntu-20.04

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

- name: Install and Build
if: github.event.action != 'closed'
env:
REACT_APP_VERSION: env:preview/pr:${{ github.event.pull_request.number }}-${{ github.run_number }}
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/
10 changes: 10 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: build-and-release

on:
push:
branches:
Expand Down Expand Up @@ -26,6 +28,10 @@ jobs:

- name: Build App
env:
REACT_APP_VERSION: ${{ vars.APP_VERSION }}.${{github.run_number}}-${{ steps.commit_hash.outputs.short }}-preview
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 }}
Expand Down Expand Up @@ -81,6 +87,10 @@ jobs:

- name: Build App
env:
REACT_APP_VERSION: ${{ vars.APP_VERSION }}.${{github.run_number}}-${{ steps.commit_hash.outputs.short }}-stable
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 }}
Expand Down
12 changes: 6 additions & 6 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ import type * as Preset from '@docusaurus/preset-classic';
import type { Options as UmamiOptions } from '@dipakparmar/docusaurus-plugin-umami';

const config: Config = {
title: 'Architecture Center - GO/S/A/TLS',
title: 'Architecture Center',
tagline: 'Best Practices & Blueprints',
favicon: 'img/favicon.ico',

// Set the production url of your site here
url: 'http://docs-next.hypelens.de',
url: 'https://' + process.env.REACT_APP_DOCS_NEXT_HOST,
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
baseUrl: process.env.REACT_APP_DOCUSAURUS_BASE_URL,

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'akyriako', // Usually your GitHub org/user name.
organizationName: process.env.REACT_APP_DOCS_NEXT_ORG, // Usually your GitHub org/user name.
projectName: 'docs-next', // Usually your repo name.
deploymentBranch: 'gh-pages',
trailingSlash: false,

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
Expand Down Expand Up @@ -211,7 +211,7 @@ const config: Config = {
],
},
],
copyright: `© T-Systems International GmbH ${new Date().getFullYear()}`,
copyright: `© T-Systems International GmbH ${new Date().getFullYear()} (` + process.env.REACT_APP_VERSION + `)`,
},
prism: {
theme: prismThemes.oneDark,
Expand Down
Loading