Skip to content

Commit

Permalink
Update update-gitbook.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Revxrsal authored Sep 20, 2024
1 parent cf2f85a commit 30b9d7e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/update-gitbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ jobs:
- name: Checkout core repository
uses: actions/checkout@v3

- name: Get release tag version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Get latest release tag from GitHub API
id: get_latest_release
run: |
LATEST_TAG=$(curl -s https://api.github.com/repos/Revxrsal/lamp/releases/latest | jq -r .tag_name)
echo "LATEST_TAG=${LATEST_TAG}" >> $GITHUB_ENV
- name: Clone GitBook repository
run: |
git clone https://github.com/Revxrsal/lamp-docs.git
Expand All @@ -25,7 +27,7 @@ jobs:
- name: Update version in README.md
run: |
cd lamp-docs
sed -i 's/[VERSION]/${{ env.VERSION }}/g' README.md
sed -i 's/[VERSION]/${{ env.LATEST_TAG }}/g' README.md
- name: Commit and push changes to GitBook repo
run: |
Expand All @@ -34,7 +36,7 @@ jobs:
git config --local user.email "${{ secrets.EMAIL }}"
git config --local user.password "${{ secrets.PAT }}"
git add README.md
git commit -m "Update documentation with version ${{ env.VERSION }}"
git commit -m "Update documentation with version ${{ env.LATEST_TAG }}"
git remote set-url origin https://x-access-token:${{ secrets.PAT }}@github.com/Revxrsal/lamp-docs.git
git push origin main
Expand Down

0 comments on commit 30b9d7e

Please sign in to comment.