Skip to content

Commit d823b37

Browse files
update azd version in gh action (#27)
* update azd version in gh action * fix: update GitHub Actions workflow and build script for documentation
1 parent eaea0c8 commit d823b37

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: actions/checkout@v4
2525

2626
- name: Install azd
27-
uses: Azure/setup-azd@v1.0.0
27+
uses: Azure/setup-azd@v2
2828

2929
- name: Log in with Azure (Federated Credentials)
3030
if: ${{ env.AZURE_CLIENT_ID != '' }}

.github/workflows/docs.yml

Lines changed: 6 additions & 4 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
docs:
811
name: Build docs
@@ -18,8 +21,7 @@ jobs:
1821
run: npm i -g @moaw/cli
1922
- name: Build and update docs
2023
run: |
21-
git config --global user.name "sinedied"
22-
git config --global user.email "[email protected]"
24+
git config --global user.name "SandraAhlgrimm"
25+
git config --global user.email "[email protected]"
2326
./scripts/repo/build-docs.sh
24-
env:
25-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
27+

scripts/repo/build-docs.sh

Lines changed: 9 additions & 5 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-java-docs
1111
GH_USER=$(git config user.name)
12-
REPO=https://$GH_USER:$GH_TOKEN@github.com/Azure-Samples/azure-openai-rag-workshop-java.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"
@@ -29,11 +31,13 @@ if [[ ${1-} == "--local" ]]; then
2931
open "$DOCS_HOME"
3032
else
3133
# Update git repo
32-
git init
33-
git checkout -b docs
34-
git remote add origin "$REPO"
34+
cd "$BASE"
35+
git fetch --depth=1
36+
git checkout docs --
37+
git rm -r '*'
38+
cp -R "$DOCS_HOME"/docs/* .
3539
git add .
36-
git commit -m "docs: prepare workshop docs"
40+
git commit -a -m "docs: prepare workshop docs"
3741
git push -u origin docs --force
3842

3943
rm -rf "$DOCS_HOME"

0 commit comments

Comments
 (0)