diff --git a/README.md b/README.md index 643c7ca..df93d97 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,11 @@ -## GitHub Actions for Hugo extended and Modules +## GitHub Actions for Hugo - [gohugoio/hugo: The world’s fastest framework for building websites.](https://github.com/gohugoio/hugo) -We can run Hugo on a virtual machine of GitHub Actions by this Hugo action. Hugo extended version and Hugo Modules are supported. +We can run **Hugo** on a virtual machine of **GitHub Actions** by this Hugo action. **Hugo extended** version and **Hugo Modules** are supported. From `v2.0.0`, this Hugo action migrated to a JavaScript (TypeScript) action. We no longer build or pull a Hugo docker image. Thanks to this change, we can complete this action less than **4 sec**. (A docker base action was taking about 1 min or more execution time to build or pull.) @@ -24,9 +24,12 @@ From `v2.0.0`, this Hugo action migrated to a JavaScript (TypeScript) action. W |---|:---:|:---:|:---:| | Support | ✅️ | ✅️ | ✅️ | + + +## Table of Contents + -*Table of Contents* - [Getting started](#getting-started) - [⭐️ Create your workflow](#%EF%B8%8F-create-your-workflow) @@ -72,7 +75,7 @@ jobs: - name: Setup Hugo uses: peaceiris/actions-hugo@v2.2.4 with: - hugo-version: '0.58.3' + hugo-version: '0.59.1' # extended: true - name: Build @@ -98,7 +101,7 @@ Set `extended: true` to use a Hugo extended version. - name: Setup Hugo uses: peaceiris/actions-hugo@v2.2.4 with: - hugo-version: '0.58.3' + hugo-version: '0.59.1' extended: true ``` @@ -117,6 +120,36 @@ This action fetches the latest version of Hugo by [hugo | Homebrew Formulae](htt +## Tips + +### Read Hugo version from file + +How to sync a Hugo version between Docker Compose YAML file and a GitHub Actions workflow using `.env` file. + +Write a `HUGO_VERSION` to the `.env` file like the following and push it to a remote branch. + +```sh +HUGO_VERSION=0.59.1 +``` + +Next, add a step to read a Hugo version from the `.env` file. + +```yaml + - name: Read .env + id: hugo-version + run: | + . ./.env + echo ::set-output name=HUGO_VERSION::${HUGO_VERSION} + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2.2.4 + with: + hugo-version: '${{ steps.hugo-version.outputs.HUGO_VERSION }}' + extended: true +``` + + + ## License - [MIT License - peaceiris/actions-hugo]