Skip to content

Commit

Permalink
Merge pull request #6 from DTLab-LabCN/main
Browse files Browse the repository at this point in the history
Merging a few infrastructure changes
  • Loading branch information
pruneau628 authored Sep 4, 2024
2 parents cee2a96 + 864da87 commit 4c52586
Show file tree
Hide file tree
Showing 5 changed files with 812 additions and 522 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
env:
DTT_DOCS_URL: ${{ vars.DTT_DOCS_URL }}
DTT_DOCS_BASE_PATH: ${{ vars.DTT_DOCS_BASE_PATH }}
DTT_DOCS_EXCLUDED_PATH: ${{ vars.DTT_DOCS_EXCLUDED_PATH }}
ORGANIZATION_NAME: ${{ github.repository_owner }}
PROJECT_NAME: ${{ github.event.repository.name }}

Expand All @@ -29,6 +30,9 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Remove excluded PATHs for build
run: .github/workflows/excluded-paths.sh

- name: Build website
# We also create the CNAME file, this is useless in staging,
# but required in production.
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/excluded-paths.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#! /usr/bin/env bash
set -e

# Note: actions always run at the root of the repository


if [ -n "$DTT_DOCS_EXCLUDED_PATH" ] && [ "$PROJECT_NAME" == "DTT-Docs-staging" ]; then
echo "Excluded PATHS in DTT_DOCS_EXCLUDED_PATH are \"$DTT_DOCS_EXCLUDED_PATH\""
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
echo "@@ @@"
echo "@@ Use of DTT_DOCS_EXCLUDED_PATH should be reserved to production @@"
echo "@@ @@"
echo "@@ >>>>>>>>> Make sure you are not doing something wrong <<<<<<<< @@"
echo "@@ @@"
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
else
echo "No path are excluded from this build, DTT_DOCS_EXCLUDED_PATH is absent or empty"
fi

for excluded_path in ${DTT_DOCS_EXCLUDED_PATH/:/ }; do
echo "Removing \"docs/${excluded_path}\" from current build"
( set -x; rm -rf "docs/${excluded_path}" )
done
6 changes: 3 additions & 3 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
env:
DTT_DOCS_URL: ${{ vars.DTT_DOCS_URL }}
DTT_DOCS_BASE_PATH: ${{ vars.DTT_DOCS_BASE_PATH }}
DTT_DOCS_EXCLUDED_PATH: ${{ vars.DTT_DOCS_EXCLUDED_PATH }}
ORGANIZATION_NAME: ${{ github.repository_owner }}
PROJECT_NAME: ${{ github.event.repository.name }}

Expand All @@ -31,9 +32,8 @@ jobs:
- name: Install dependencies
run: npm ci

# - name: list environment variables
# run: |
# env && exit 1
- name: Remove excluded PATHs for build
run: .github/workflows/excluded-paths.sh

- name: Test build website
# We also create the CNAME file, this is useless in staging,
Expand Down
Loading

0 comments on commit 4c52586

Please sign in to comment.