From 413db19c6de1181359aff3b348c56a2a15dc2e3f Mon Sep 17 00:00:00 2001 From: Brieuc Dubois Date: Fri, 19 Jan 2024 12:47:18 +0100 Subject: [PATCH] gitea CI --- .gitea/workflows/release.yaml | 40 +++++++++++++++++++++++++++++++++++ .gitmodules | 2 +- Dockerfile | 17 +++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/release.yaml create mode 100644 Dockerfile diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..9ca73bd --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,40 @@ +name: Build and publish +run-name: ${{ gitea.actor }} is runs ci pipeline +on: + push: + branches: + - master + +jobs: + docker: + runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:act-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + config-inline: | + [registry."git.bhasher.com"] + http = true + insecure = true + + - name: Login + uses: docker/login-action@v2 + with: + registry: git.bhasher.com + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + platforms: | + linux/amd64 + linux/arm64 + tags: | + git.bhasher.com/bhasher/blog:latest diff --git a/.gitmodules b/.gitmodules index e099614..e84a7c7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "themes/hugo-blog-awesome"] path = themes/hugo-blog-awesome - url = git@github.com:hugo-sid/hugo-blog-awesome.git + url = https://github.com/hugo-sid/hugo-blog-awesome.git diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1331386 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM alpine:latest AS build + +RUN apk add --update hugo + +WORKDIR /opt/HugoApp + +COPY . . + +RUN hugo + +FROM nginx:1.25-alpine + +WORKDIR /usr/share/nginx/html + +COPY --from=build /opt/HugoApp/public . + +EXPOSE 80/tcp