docs: github action version updates (#1977)

* docs: github action version updates

* Uses latest version of the action
* Updated requirement for token to be set
  (138a3568d1/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
This commit is contained in:
Edward Maxwell-Lyte 2022-08-30 09:28:49 +01:00 committed by GitHub
parent 7f4060b82a
commit ad6c834123
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,9 +30,9 @@ Using *Github Actions* for the deployment of your Zola-Page on Github-Pages is p
2. Create the *Github Action*. 2. Create the *Github Action*.
3. Check the *Github Pages* section in repository settings. 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. 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.
@ -54,6 +54,8 @@ jobs:
PAGES_BRANCH: gh-pages PAGES_BRANCH: gh-pages
# Provide personal access token # Provide personal access token
TOKEN: ${{ secrets.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). 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).
@ -75,9 +77,9 @@ jobs:
if: github.ref != 'refs/heads/main' if: github.ref != 'refs/heads/main'
steps: steps:
- name: 'checkout' - name: 'checkout'
uses: actions/checkout@v2 uses: actions/checkout@v3.0.0
- name: 'build' - name: 'build'
uses: shalzz/zola-deploy-action@v0.13.0 uses: shalzz/zola-deploy-action@v0.16.1
env: env:
PAGES_BRANCH: gh-pages PAGES_BRANCH: gh-pages
BUILD_DIR: . BUILD_DIR: .
@ -88,9 +90,9 @@ jobs:
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'
steps: steps:
- name: 'checkout' - name: 'checkout'
uses: actions/checkout@v2 uses: actions/checkout@v3.0.0
- name: 'build and deploy' - name: 'build and deploy'
uses: shalzz/zola-deploy-action@v0.13.0 uses: shalzz/zola-deploy-action@v0.16.1
env: env:
PAGES_BRANCH: master PAGES_BRANCH: master
BUILD_DIR: . BUILD_DIR: .