peaceiris / actions-hugo

GitHub Actions for Hugo ⚡️ Setup Hugo quickly and build your site fast. Hugo extended, Hugo Modules, Linux (Ubuntu), macOS, and Windows are supported.
https://github.com/marketplace/actions/hugo-setup
MIT License
1.37k stars 80 forks source link

support: How to use the GitHub's encrypted secrets ? #615

Closed CYS-Photographie closed 1 year ago

CYS-Photographie commented 1 year ago

Checklist

Describe your question

Hi, I would like to use the encrypted repository secret "HUGO_GOOGLEANALYTICS" that I store into my repository to be used into your script.

The reason to not have it directly into the config file is that I'm actually doing tests and the website is deployed also into vercel and netlify. So I've configured the env variables into the 2 others and all is good, Google Analytics tracker is present when I check it with Privacy Badger.

I've added some code into my gh-pages.yml to retrieve and use the ID of GA, but at each deploy Privacy Badger seems to show that no tracker is implemented (nothing at all into GA also).

Relevant links

Public repository: https://github.com/CYS-Photographie/CYS-Photographie.github.io
YAML config: https://github.com/CYS-Photographie/CYS-Photographie.github.io/blob/master/config.yaml
YAML workflow: https://github.com/CYS-Photographie/CYS-Photographie.github.io/blob/master/.github/workflows/gh-pages.yml
Actions workflow & logs : https://github.com/CYS-Photographie/CYS-Photographie.github.io/actions/runs/3271600856

Relevant log output

It seems to have no error regarding the summary

Additional context.

Skill level of coding : pretty low. No more additional context. Thanks for your help !

CYS-Photographie commented 1 year ago

I success to make it worked with this adding on build :

      - name: Build
        run: hugo --gc --minify
        env: # Or as an environment variable
          HUGO_GOOGLEANALYTICS: ${{ secrets.HUGO_GOOGLEANALYTICS }}

I surely added bad way the first time. I close the issue.

github-actions[bot] commented 1 year ago

This issue has been LOCKED because of it being resolved!

The issue has been fixed and is therefore considered resolved. If you still encounter this or it has changed, open a new issue instead of responding to solved ones.

Log | Bot Usage