Skip to content

Commit

Permalink
docs: github action version updates (getzola#1977)
Browse files Browse the repository at this point in the history
* docs: github action version updates

* Uses latest version of the action
* Updated requirement for token to be set
  (https://github.com/shalzz/zola-deploy-action/blob/138a3568d1045f57bcdfec4b66ad37ac3dca5475/entrypoint.sh#L44
  will exit out without it)
* Reduced TOKEN scope and added scope to URL. Aligns with action docs

* docs: revert commentary on token requirement

* docs: add note about passing in automatic token
  • Loading branch information
edwardmlyte authored and flxzt committed Sep 11, 2022
1 parent 68910b6 commit 78441bf
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions docs/content/documentation/deployment/github-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ Using *Github Actions* for the deployment of your Zola-Page on Github-Pages is p
2. Create the *Github Action*.
3. Check the *Github Pages* section in repository settings.

Let's start with the token. Remember, if you are publishing the site on the same repo, you do not need to follow that step.
Let's start with the token. Remember, if you are publishing the site on the same repo, you do not need to follow that step. But you will still need to pass in the automatic `GITHUB_TOKEN` as explained [here](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#example-1-passing-the-github_token-as-an-input).

For creating the token either click on [here](https://github.com/settings/tokens) or go to Settings > Developer Settings > Personal access tokens. Under the *Select Scopes* section, give it *repo* permissions and click *Generate token*. Then copy the token, navigate to your repository and add in the Settings tab the *Secret* `TOKEN` and paste your token in it.
For creating the token either click on [here](https://github.com/settings/tokens/new?scopes=public_repo) or go to Settings > Developer Settings > Personal access tokens. Under the *Select Scopes* section, give it *public_repo* permissions and click *Generate token*. Then copy the token, navigate to your repository and add in the Settings tab the *Secret* `TOKEN` and paste your token in it.

Next we need to create the *Github Action*. Here we can make use of the [zola-deploy-action](https://github.com/shalzz/zola-deploy-action). Go to the *Actions* tab of your repository, click on *set up a workflow yourself* to get a blank workflow file. Copy the following script into it and commit it afterwards; note that you may need to change the `github.ref` branch from `main` to `master` or similar, as the action will only run for the branch you choose.

Expand All @@ -54,6 +54,8 @@ jobs:
PAGES_BRANCH: gh-pages
# Provide personal access token
TOKEN: ${{ secrets.TOKEN }}
# Or if publishing to the same repo, use the automatic token
#TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

This script is pretty simple, because the [zola-deploy-action](https://github.com/shalzz/zola-deploy-action) is doing everything for you. You just need to provide some details. For more configuration options check out the [README](https://github.com/shalzz/zola-deploy-action/blob/master/README.md).
Expand All @@ -75,9 +77,9 @@ jobs:
if: github.ref != 'refs/heads/main'
steps:
- name: 'checkout'
uses: actions/checkout@v2
uses: actions/checkout@v3.0.0
- name: 'build'
uses: shalzz/zola-deploy-action@v0.13.0
uses: shalzz/zola-deploy-action@v0.16.1
env:
PAGES_BRANCH: gh-pages
BUILD_DIR: .
Expand All @@ -88,9 +90,9 @@ jobs:
if: github.ref == 'refs/heads/main'
steps:
- name: 'checkout'
uses: actions/checkout@v2
uses: actions/checkout@v3.0.0
- name: 'build and deploy'
uses: shalzz/zola-deploy-action@v0.13.0
uses: shalzz/zola-deploy-action@v0.16.1
env:
PAGES_BRANCH: master
BUILD_DIR: .
Expand Down

0 comments on commit 78441bf

Please sign in to comment.