Skip to content

Commit

Permalink
Added working structure with CI + Docker img.
Browse files Browse the repository at this point in the history
  • Loading branch information
cguertin14 committed May 15, 2021
1 parent 96139e5 commit fa14859
Show file tree
Hide file tree
Showing 161 changed files with 4,497 additions and 1,911 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: ci

on:
push:
tags:
- 'v*.*.*'

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
cguertz/cguertin.dev
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: cguertz/cguertin.dev:${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "themes/PaperMod"]
path = themes/PaperMod
path = src/themes/PaperMod
url = https://github.com/adityatelange/hugo-PaperMod.git
branch = "v5.0"
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Stage 1 - builder
FROM golang:1.16.4-alpine AS build

LABEL maintainer="Charles Guertin"

RUN apk add --update --no-cache git && \
apk upgrade

ENV HUGO_VERSION=v0.83.1
RUN go get -u github.com/gohugoio/hugo@${HUGO_VERSION}

COPY src/ /src
WORKDIR /src
RUN hugo


# Step 2 - runtime
FROM nginx:1.20.0-alpine AS runtime
COPY --from=build /src/public/ /usr/share/nginx/html
CMD ["nginx", "-g", "daemon off;"]
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.PHONY: src nginx

default: build

build:
@docker build -t cguertz/cguertin.dev .

dev:
@hugo serve --source=./src -D
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# cguertin.dev

Personal website build using [Hugo](https://gohugo.io).
Personal website built using [Hugo](https://gohugo.io).
26 changes: 0 additions & 26 deletions configTaxo.yml

This file was deleted.

6 changes: 0 additions & 6 deletions content/archives.fr.md

This file was deleted.

50 changes: 0 additions & 50 deletions content/posts/emoji-support.md

This file was deleted.

152 changes: 0 additions & 152 deletions content/posts/markdown-syntax.fa.md

This file was deleted.

Loading

0 comments on commit fa14859

Please sign in to comment.