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

fix(ci): docs not being deployed automatically when releasing a new template version #105

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions .github/workflows/new-template-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@
#

# 🚨 GITHUB SECRETS REQUIRED:
# - GH_TOKEN: A GitHub token with write repo access.
# You can generate one from here: https://github.com/settings/tokens
# make sure to add it to the repo secrets with the name GH_TOKEN
# Attention: Not to be confused with the GITHUB_TOKEN, this is a different token with different permissions.
# - NEW_TEMPLATE_VERSION_PAT: A fine-grained Personal Access Token.
# This token is used to commit, push and create a new release in the template repository.
# You can generate one from here: https://github.com/settings/tokens?type=beta
# Set the Repository access to "Only select repositories" and select the template repository.
# Set the following Repo permissions:
# - Contents: Read & write (to commit, push and create a new release)
# - Metadata: Read-only (mandatory by GitHub)
# - Actions: Read and write (to allow triggering other workflows, like docs deployment)
# Make sure to add it to the repo secrets with the name NEW_TEMPLATE_VERSION_PAT:
# - Go to Repository Settings > Secrets and variables > Actions > New repository secret
# - Name: NEW_TEMPLATE_VERSION_PAT
# - Value: The Personal Access Token you created

name: New Template Version

Expand All @@ -45,17 +53,18 @@ jobs:
permissions:
contents: write
steps:
- name: 🔍 GH_TOKEN
if: env.GH_TOKEN == ''
- name: Check if Personal Access Token exists
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV
PAT: ${{ secrets.NEW_TEMPLATE_VERSION_PAT }}
if: env.PAT == ''
run: |
echo "NEW_TEMPLATE_VERSION_PAT secret not found. Please create a fine-grained Personal Access Token following the instructions in the workflow file."
exit 1
- name: 📦 Checkout project repo
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}

token: ${{ secrets.NEW_TEMPLATE_VERSION_PAT }}
- name: 📝 Git User Setup
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
Expand All @@ -78,3 +87,4 @@ jobs:
tag: v${{ env.NEW_VERSION }}
generateReleaseNotes: true
draft: false
token: ${{ secrets.NEW_TEMPLATE_VERSION_PAT }}
Loading