Compare commits
5 commits
74b46aacf3
...
b4bc5c016f
| Author | SHA1 | Date | |
|---|---|---|---|
| b4bc5c016f | |||
| 893b80d262 | |||
| f3d7ff5d71 | |||
| 2059de21da | |||
| e9d50af0ae |
5 changed files with 91 additions and 1 deletions
|
|
@ -15,6 +15,7 @@ body:
|
||||||
attributes:
|
attributes:
|
||||||
label: "Topic:"
|
label: "Topic:"
|
||||||
multiple: true
|
multiple: true
|
||||||
|
default: 0
|
||||||
options:
|
options:
|
||||||
- Garden
|
- Garden
|
||||||
- Blog
|
- Blog
|
||||||
|
|
|
||||||
65
.forgejo/workflows/build-docker-image.yaml
Normal file
65
.forgejo/workflows/build-docker-image.yaml
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
name: Publish image
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
create-docker-images:
|
||||||
|
runs-on: host
|
||||||
|
steps:
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: git.alecodes.page
|
||||||
|
username: ${{ vars.CONTAINER_REGISTRY_USER }}
|
||||||
|
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
git.alecodes.page/alecodes/page:latest
|
||||||
|
git.alecodes.page/alecodes/page:${{ github.sha }}
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- create-docker-images
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: 'Docker Stack Deploy'
|
||||||
|
uses: https://github.com/cssnr/stack-deploy-action@v1
|
||||||
|
with:
|
||||||
|
host: ${{ vars.DOCKER_SWARM_HOST }}
|
||||||
|
port: ${{ vars.DOCKER_SWARM_PORT }}
|
||||||
|
user: ${{ secrets.DOCKER_SWARM_USER }}
|
||||||
|
ssh_key: '${{ secrets.DOCKER_SWARM_SSH_KEY }}'
|
||||||
|
file: 'docker-stack.yaml'
|
||||||
|
name: 'personal-page'
|
||||||
|
|
||||||
|
rebase:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: deploy
|
||||||
|
if: success()
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: '0'
|
||||||
|
ref: content-update
|
||||||
|
|
||||||
|
- name: Update branch
|
||||||
|
run: |
|
||||||
|
set -x
|
||||||
|
git config --global user.name "robo"
|
||||||
|
git config --global user.email "robo@alecodes.page"
|
||||||
|
git rebase origin/main
|
||||||
|
git push origin content-update --force-with-lease
|
||||||
9
Dockerfile
Normal file
9
Dockerfile
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
FROM --platform=linux/amd64 ghcr.io/getzola/zola:v0.19.2 AS builder
|
||||||
|
|
||||||
|
COPY . /project
|
||||||
|
WORKDIR /project
|
||||||
|
RUN ["zola", "build"]
|
||||||
|
|
||||||
|
FROM ghcr.io/static-web-server/static-web-server:2
|
||||||
|
WORKDIR /
|
||||||
|
COPY --from=builder /project/dist /public
|
||||||
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
+++
|
+++
|
||||||
|
|
||||||
# This is a awesome page :D
|
# This is a **really** awesome page :D
|
||||||
|
|
|
||||||
15
docker-stack.yaml
Normal file
15
docker-stack.yaml
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
networks:
|
||||||
|
reverse-proxy:
|
||||||
|
external: true
|
||||||
|
|
||||||
|
services:
|
||||||
|
page:
|
||||||
|
image: git.alecodes.page/alecodes/page:${GITHUB_SHA:-latest}
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- reverse-proxy
|
||||||
|
deploy:
|
||||||
|
labels:
|
||||||
|
- traefik.enable=true
|
||||||
|
- traefik.http.routers.personal-page.rule=Host(`alecodes.page`)
|
||||||
|
- traefik.http.services.personal-page.loadbalancer.server.port=80
|
||||||
Loading…
Add table
Add a link
Reference in a new issue