adding docker hub publishing

This commit is contained in:
Andy Pack 2023-06-26 17:22:51 +01:00
parent 164fee42fc
commit c5716f0392
Signed by: sarsoo
GPG Key ID: A55BA3536A5E0ED7
3 changed files with 44 additions and 1 deletions

30
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: docker
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Container
uses: docker/build-push-action@v2
with:
push: true
tags: sarsoo/sarsooxyz.hugo:latest
file: Dockerfile.pub

View File

@ -30,7 +30,7 @@ jobs:
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.99.0
HUGO_VERSION: 0.114.1
steps:
- name: Install Hugo CLI
run: |

13
Dockerfile.pub Normal file
View File

@ -0,0 +1,13 @@
FROM alpine as build
RUN apk add hugo
COPY . /sarsooxyz.hugo
WORKDIR /sarsooxyz.hugo
RUN hugo \
--minify \
--baseURL https://sarsoo.xyz/
FROM nginx:alpine-slim
COPY --from=build /sarsooxyz.hugo/public /usr/share/nginx/html/