Github Workflow to S3/CloudFront - could if be nodeJS free?

Hi there, I managed to get my ex-ikiwiki site on S3/Cloudfront via

I created an IAM user for AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY secret:

    "Version": "2012-10-17",
    "Statement": [
            "Sid": "Stmt1460356082000",
            "Effect": "Allow",
            "Action": [
            "Resource": [

And another inline policy of:

    "Version": "2012-10-17",
    "Statement": [
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": "cloudfront:CreateInvalidation",
            "Resource": "*"

I do find it concerning that JS seems to required for the Github action and peaceiris/actions-hugo seems far from simple:

Is there a simpler way??

I don’t have experience with GitHub Actions. But I did use s3deploy with my S3/Cloudfront setup. That worked good and quick.

Hugo also has the built-in hugo deploy command, which can also upload to S3 and invalidate Cloudfront.

Both options are JS free and hugo deploy is probably the easiest to setup since it’s already inside Hugo.

I run hugo deploy; it’s just that there doesn’t appear to be an official Hugo Docker image hence I am using the very odd peaceiris/actions-hugo action.

That Action just downloads a Hugo binary. You can do that by yourself with wget and tar.

Or, we can create a Docker image for Hugo by ourself like this: peaceiris/hugo-extended-docker

I think I prefer the Docker approach, but how does that look upon a Github Action?

Is it runs-on: peaceiris/hugo:latest?

Not sure how actions/checkout@master et al works…

We can run a Docker container the same as a local machine. actions/checkout@v1 or v2 check out a HEAD commit of GitHub events. (push commits, push tags, and so on.)

Any ideas what I am doing wrong here?

name: Deploy Hugo site to S3/Cloudfront

      - master

    runs-on: ubuntu-18.04
      image: peaceiris/hugo:v0.64.1
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
      - uses: actions/checkout@v1
      - run: hugo --minify
      - run: hugo deploy

I do not know the details of container: syntax…

It works on my repo:

It took 15 sec to initialize the container, the container option is slower than using peaceiris/actions-hugo

If you require the Hugo modules, you can use peaceiris/hugo:v0.64.1-mod.

Thank you, Got it working here: … it appears as fast as before ~30s.

Must say I find it weird that I need to specify the container image Ubuntu in order to run your image in the lines:

runs-on: ubuntu-latest
    image: peaceiris/hugo
1 Like

I misread your domain name as and thought oh my, that looks like a lucrative domain name… :slight_smile:

Haha, happy to sell :stuck_out_tongue: