-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from airtai/dev
- Loading branch information
Showing
129 changed files
with
20,691 additions
and
30 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
*.png filter=lfs diff=lfs merge=lfs -text | ||
*.ttf filter=lfs diff=lfs merge=lfs -text | ||
*.woff filter=lfs diff=lfs merge=lfs -text | ||
*.woff2 filter=lfs diff=lfs merge=lfs -text | ||
*.eot filter=lfs diff=lfs merge=lfs -text | ||
*.ico filter=lfs diff=lfs merge=lfs -text |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Switch Maintenance Mode | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
choice: | ||
type: choice | ||
description: "Switch mode: maintenance or working" | ||
required: true | ||
default: "working" | ||
options: | ||
- "maintenance" | ||
- "working" | ||
|
||
jobs: | ||
switch_maintenance_mode: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
# Give the default GITHUB_TOKEN write permission to commit and push the | ||
# added or changed files to the repository. | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Fetch main branch | ||
run: git fetch origin main --depth=1 | ||
|
||
- name: Checkout main branch | ||
run: git checkout main | ||
|
||
- name: Copy maintenance.html to tmp directory | ||
run: | | ||
mkdir tmp | ||
cp maintenance.html tmp/ | ||
- name: Get current UTC timestamp and inject into maintenance.html | ||
run: | | ||
timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | ||
echo "Current UTC timestamp: ${timestamp}" | ||
sed -i "s|WRITE_TIMESTAMP_HERE|${timestamp}|" tmp/maintenance.html | ||
- name: Switch to gh-pages branch | ||
run: | | ||
git fetch origin gh-pages --depth=1 | ||
git checkout gh-pages | ||
- name: Prepare for mode switch | ||
run: | # nosemgrep | ||
if [ "${{ github.event.inputs.choice }}" == "maintenance" ]; then | ||
timestamp=$(date +"%Y%m%d%H%M%S") | ||
mv index.html index_${timestamp}.html | ||
mv tmp/maintenance.html index.html | ||
elif [ "${{ github.event.inputs.choice }}" == "working" ]; then | ||
latest_index=$(ls -t index_*.html | head -1) | ||
mv $latest_index index.html | ||
else | ||
echo "Invalid choice specified" | ||
exit 1 | ||
fi | ||
- name: Cleanup temporary directory | ||
run: rm -rf tmp | ||
|
||
- name: Commit mode switch changes | ||
uses: stefanzweifel/git-auto-commit-action@v5 |
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
Oops, something went wrong.