web-ci/.github/workflows/build.yml
mrinc 64e3b38876 chore(build.yml): update matrix for hugo-version, node-version, and go-version
chore(build.yml): update build-args and tags for docker build
chore(Dockerfile): add NODE_VERSION argument and update wget and tar commands
chore(README.md): update README with information about the latest docker container and usage instructions
2023-07-25 11:51:07 +02:00

101 lines
2.6 KiB
YAML

name: Build And Publish Docker
on:
push:
branches:
- "master"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
hugo-version:
[
"0.112.6",
"0.112.7",
"0.113.0",
"0.114.0",
"0.114.1",
"0.115.0",
"0.115.1",
"0.115.2",
"0.115.3",
"0.115.4",
]
node-version: ["16", "18"]
go-version: ["1", "1.19", "1.19.11", "1.20", "1.20.5", "1.20.6"]
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build
uses: docker/build-push-action@v4
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./
file: ./Dockerfile
platforms: linux/amd64 # ,linux/arm64/v8
push: true
build-args: |
HUGO_VERSION=${{ matrix.hugo-version }}
NODE_VERSION=${{ matrix.node-version }}
GO_VERSION=${{ matrix.go-version }}
tags: |
betterweb/hugo:${{ matrix.hugo-version }}-${{ matrix.node-vesion }}-${{ matrix.go-vesion }}
betterweb/hugo:${{ matrix.hugo-version }}-${{ matrix.node-vesion }}-${{ matrix.go-vesion }}-extended
build-latest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build
uses: docker/build-push-action@v4
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./
file: ./Dockerfile
platforms: linux/amd64 # ,linux/arm64/v8
push: true
build-args: |
HUGO_VERSION=0.115.4
NODE_VERSION=18
GO_VERSION=1.20
tags: |
betterweb/hugo:latest
betterweb/hugo:latest-extended