113 lines
2.8 KiB
YAML
113 lines
2.8 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",
|
|
"0.116.0",
|
|
"0.116.1",
|
|
"0.117.0",
|
|
"0.118.0",
|
|
"0.118.1",
|
|
"0.118.2",
|
|
"0.119.0",
|
|
"0.120.1",
|
|
"0.120.2",
|
|
"0.120.3",
|
|
"0.120.4",
|
|
"0.121.0",
|
|
"0.121.1"
|
|
]
|
|
node-version: ["18", "20", "21"]
|
|
go-version: ["1", "1.19", "1.19.11", "1.20", "1.20.5", "1.20.6", "1.21.5"]
|
|
|
|
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:extended-${{ matrix.hugo-version }}-${{ matrix.node-version }}-${{ matrix.go-version }}"
|
|
|
|
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:extended-latest
|