Skip to content

Commit 96e4b49

Browse files
committed
ci: fix docs workflow
1 parent 7218d67 commit 96e4b49

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

.github/workflows/docs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ on:
33
push:
44
branches: [main]
55

6+
permissions:
7+
contents: write
8+
69
jobs:
710
build:
811
name: Build docs
@@ -21,5 +24,3 @@ jobs:
2124
git config --global user.name "sinedied"
2225
git config --global user.email "[email protected]"
2326
./scripts/repo/build-docs.sh
24-
env:
25-
GH_TOKEN: ${{ secrets.GH_TOKEN }}

scripts/repo/build-docs.sh

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ cd "$(dirname "${BASH_SOURCE[0]}")/../.."
99

1010
DOCS_HOME=/tmp/azure-openai-rag-workshop-docs
1111
GH_USER=$(git config user.name)
12-
REPO=https://$GH_USER:$GH_TOKEN@github.com/Azure-Samples/azure-openai-rag-workshop.git
12+
REPO=$(git remote get-url origin)
13+
BASE=$(pwd)
1314

15+
echo "Target repository: $REPO"
1416
echo "Preparing all workshop docs..."
1517
echo "(temp folder: $DOCS_HOME)"
1618
rm -rf "$DOCS_HOME"
@@ -30,12 +32,20 @@ if [[ ${1-} == "--local" ]]; then
3032
open "$DOCS_HOME"
3133
else
3234
# Update git repo
33-
git init
34-
git checkout -b docs
35-
git remote add origin "$REPO"
35+
cd "$BASE"
36+
git checkout docs
37+
rm -rf *
38+
cp -R "$DOCS_HOME"/* .
3639
git add .
37-
git commit -m "docs: prepare workshop docs"
38-
git push -u origin docs --force
40+
git commit --amend -m "docs: prepare workshop docs"
41+
git push --force
42+
43+
# git init
44+
# git checkout -b docs
45+
# git remote add origin "$REPO"
46+
# git add .
47+
# git commit -m "docs: prepare workshop docs"
48+
# git push -u origin docs --force
3949

4050
rm -rf "$DOCS_HOME"
4151
fi

0 commit comments

Comments
 (0)