diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 10f2492ce..db40baa6d 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -4,10 +4,10 @@ name: Deploy static content to Pages on: # Runs on pushes targeting the default branch push: - branches: ["master"] + branches: "current_branch" pull_request: branches: - - '*' + - "*" # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages @@ -19,8 +19,44 @@ concurrency: cancel-in-progress: false jobs: + replace_string: + runs-on: ubuntu-latest + steps: + - name: Set environment variable for branch name + env: + BRANCH_NAME: ${{ github.ref }} + run: echo "Branch name is $BRANCH_NAME" + - name: Set environment variable for complete repo name + env: + REPO_NAME: ${{ github.repository }} + run: echo "Repository name is $REPO_NAME" + - name: Set repo name + run: | + project_name="quantstack.github.io" + echo "The value of my_string is: $project_name" + - name: Set environment variable for owner name + env: + REPO_OWNER: ${{ github.repository_owner }} + run: echo "Repository name is $REPO_OWNER" + - name: Set environment variable for actor + env: + ACTOR_NAME: ${{ github.actor }} + run: echo "Actor is $ACTOR_NAME" + - name: Replace baseUrl in config file + run: | + prev_base_url=`baseUrl: "/"` + new_base_url=`baseUrl: "/quantstack.github.io/"` + organization= `organizationName: "/QuantStack/"` + fork_name= `organizationName:` + "$ACTOR_NAME" + echo "organization is $organization" + echo "fork_name is $fork_name" + sed -i 's/prev_base_url/new_base_url/g' docusaurus.config.ts + sed -i 's/prev_organization/new_base_url/g' docusaurus.config.ts + cat > test.ts + build: runs-on: ubuntu-latest + needs: replace_string steps: - name: Checkout uses: actions/checkout@v4 @@ -39,7 +75,7 @@ jobs: deploy: needs: build - if: github.ref == 'refs/heads/master' + #if: github.ref == 'refs/heads/master' environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} @@ -51,4 +87,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v4 \ No newline at end of file