You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/userGuide/deployingTheSite.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,6 +121,33 @@ jobs:
121
121
<box type="info">
122
122
123
123
The sample `deploy.yml` workflow above uses the [default GitHub Token secret](https://docs.github.com/en/actions/reference/authentication-in-a-workflow) that is generated automatically for each GitHub Actions workflow. You may also use a [GitHub Personal Access Token](#generating-a-github-personal-access-token) in place of the default GitHub Token.
124
+
125
+
Note that **Cross-repository deployments require a Personal Access Token (PAT)**, as the built-in `GITHUB_TOKEN` is scoped to the repository that triggered the workflow and **cannot push to a different repository**. If your `site.json` specifies a `deploy.repo` that differs from the repository running the workflow, the deploy will fail with an authentication error.
126
+
127
+
To deploy to a different repository:
128
+
1. [Generate a PAT](#generating-a-github-personal-access-token) with **Contents: Read and Write** permission
129
+
(for fine-grained tokens), or **repo** scope (for classic tokens).
130
+
1. Store it as a repository secret (e.g. `PAT_TOKEN`) in the repository running the workflow.
131
+
1. In your workflow file, you can map the secret to an environment variable and provide its name to MarkBind:
132
+
- **Default Option:** Map the secret to `GITHUB_TOKEN` and use `markbind deploy --ci`.
133
+
```yml
134
+
env:
135
+
GITHUB_TOKEN: {% raw %}${{ secrets.PAT_TOKEN }}{% endraw %}
136
+
run: markbind deploy --ci
137
+
```
138
+
- **Custom Option:** Map the secret to an environment variable of your choice (e.g., `MY_TOKEN`) and pass its name to the `--ci` flag.
139
+
```yml
140
+
env:
141
+
MY_TOKEN: {% raw %}${{ secrets.PAT_TOKEN }}{% endraw %}
142
+
run: markbind deploy --ci MY_TOKEN
143
+
```
144
+
145
+
<box type="tip">
146
+
147
+
If you see `markbind deploy` reporting success but your cross-repository site is not updated, check that you are not using the default `GITHUB_TOKEN` for a cross-repository deployment. MarkBind will log a warning if it detects this situation.
148
+
149
+
</box>
150
+
124
151
</box>
125
152
126
153
Once you have created the file, commit and push the file to your repo.
0 commit comments