Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tags unable to deploy to pages #151

Closed
akshaybabloo opened this issue Mar 31, 2023 · 3 comments
Closed

Tags unable to deploy to pages #151

akshaybabloo opened this issue Mar 31, 2023 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@akshaybabloo
Copy link

I am trying to deploy to pages when the software is released. But I keep getting error saying that Branch "v1.1.2" is not allowed to deploy to github-pages due to environment protection rules.

The actions file look like:

name: Deploy Sphinx Docs to GitHub Pages

on:
  release:
    types: [ published ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
  contents: read
  pages: write
  id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
  group: "pages"
  cancel-in-progress: false

jobs:
  # Build job
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Setup Pages
        uses: actions/configure-pages@v3
      - name: Setup Python
        uses: actions/setup-python@v3
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install pipenv
          pipenv install --dev
      - name: Build
        run: |
          cd _docs
          pipenv run make html
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v1
        with:
          path: _docs/_build/html

  # Deployment job
  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v2

it works fine on main branch

@yoannchaudet
Copy link
Collaborator

Environment protection rules only support branches today.

If if your Pages settings, you have set the Source to GitHub Actions, you may be able to remove the protection rule and let your site deploy. I have not tried. Check https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-branches and try selecting the "All branches" option for your github-pages environment.

@JamesMGreene
Copy link
Contributor

ℹ️ Basically a duplicate of #76.

@JamesMGreene JamesMGreene added the duplicate This issue or pull request already exists label Apr 1, 2023
@akshaybabloo
Copy link
Author

That actually worked. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants