Skip to content

Commit

Permalink
Make github pages url dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Oct 22, 2024
1 parent f776266 commit 3498d32
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/tests_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,20 @@ jobs:
- name: List contents of data/attachments
run: ls -l data/attachments

- name: Get branch name
id: get_branch_name
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV

- name: Set destination branch for GitHub Pages
id: set-destination-branch
run: echo "DESTINATION_BRANCH=gh-pages-${{ env.BRANCH_NAME }}" >> $GITHUB_ENV

- name: Deploy Allure report to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .
destination_branch: gh-pages-dev
destination_branch: ${{ env.DESTINATION_BRANCH }}

- name: Check contents of gh-pages
run: ls -la
Expand All @@ -153,7 +161,8 @@ jobs:
script: |
const repo = context.repo.repo;
const owner = context.repo.owner;
const pagesUrl = `https://${owner}.github.io/${repo}`;
const branchName = '${{ env.BRANCH_NAME }}'
const pagesUrl = https://${owner}.github.io/${repo}/gh-pages-${branchName}`;
core.setOutput('pages_url', pagesUrl);
- name: Output GitHub Pages URL
Expand Down

0 comments on commit 3498d32

Please sign in to comment.