File tree Expand file tree Collapse file tree 6 files changed +89
-1
lines changed
Expand file tree Collapse file tree 6 files changed +89
-1
lines changed Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - main
7+ - hetzner-deploy-frontend
78# pull_request:
89# types: [ opened, synchronize, reopened ]
910
11+ env :
12+ TAG : ${{ github.head_ref || github.ref_name }}-${{ github.run_number }}
13+
1014jobs :
11- build-deploy-static-site :
15+ build-deploy-azure- static-site :
1216 runs-on : ubuntu-latest
1317 name : Build and deploy static site
1418 steps :
5155 api_location : " " # Api source code path - optional
5256 # ##### End of Repository/Build Configurations ######
5357
58+ build-frontend-container :
59+ runs-on : ubuntu-24.04
60+ steps :
61+ - uses : actions/checkout@v5
62+ - name : Log in to GitHub Container Registry
63+ uses : redhat-actions/podman-login@v1
64+ with :
65+ username : ${{ github.actor }}
66+ password : ${{ secrets.GITHUB_TOKEN }}
67+ registry : ghcr.io
68+ - name : Build container image
69+ run : ./webtool/deploy/frontend/build.sh --push
70+
71+ deploy-podhost :
72+ runs-on : ubuntu-24.04
73+ needs : build-frontend-container
74+ steps :
75+ - uses : actions/checkout@v5
76+ - name : Install SSH key
77+ uses : shimataro/ssh-key-action@v2
78+ with :
79+ key : ${{ secrets.PODHOST_SSH_PRIVATE_KEY }}
80+ known_hosts : podhost.zenmo.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKVeen0rfyMwiAoQCpIUJ/a2tpM35D/BdEDUyfRTxiXm
81+ - name : Deploy podhost
82+ run : ./webtool/deploy/quadlets/deploy.sh
83+
5484 deploy-backend :
5585 runs-on : ubuntu-latest
5686 steps :
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -ex
4+
5+ cd $( dirname " $0 " )
6+
7+ TAG=" ${TAG:- dev} "
8+
9+ podman build \
10+ --file Dockerfile \
11+ --ignorefile .dockerignore \
12+ --tag ghcr.io/zenmo/coco-frontend:$TAG \
13+ --progress=plain \
14+ $@ \
15+ ../..
Original file line number Diff line number Diff line change 1+
2+ [Container]
3+ ContainerName=coco-frontend
4+ Image=ghcr.io/zenmo/coco-frontend:$TAG
5+
6+ Network=main.network
7+ Label=traefik.enable=true
8+ Label=traefik.http.routers.coco-frontend.rule=Host(`coco.local4local.nu`) || Host(`cooperatieconfigurator.local4local.nu`)
9+ Label=traefik.http.routers.coco-frontend.tls.certResolver=HttpChallenge
10+ Label=traefik.http.routers.coco-frontend.tls.domains[0].main=coco.local4local.nu
11+ Label=traefik.http.routers.coco-frontend.tls.domains[1].main=cooperatieconfigurator.local4local.nu
12+ Label=traefik.http.routers.coco-frontend.middlewares[0]=coco-redirect
13+ Label=traefik.http.middlewares.coco-redirect.redirectRegex.regex=^https://cooperatieconfigurator.local4local.nu/(.*)
14+ Label=traefik.http.middlewares.coco-redirect.redirectRegex.replacement=https://coco.local4local.nu/${1}
15+
16+ [Service]
17+ Restart=always
18+ TimeoutStartSec=300
19+
20+ [Install]
21+ WantedBy=default.target
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Set up Quadlet config files, copy them to the Podman host, and restart the services.
3+ # This is a simplified version of the script at https://github.com/Zenmo/lux-website/blob/main/deploy/quadlets/deploy.sh
4+
5+ set -ex
6+ cd $( dirname " $0 " )
7+
8+ OUTPUT_DIR=coco
9+ mkdir -p $OUTPUT_DIR
10+
11+ # Prepare Quadlet files
12+ for filename in * .container; do
13+ envsubst < " $filename " > " $OUTPUT_DIR /$filename "
14+ done
15+
16+ # Copy files to the Podman host
17+ scp -r $OUTPUT_DIR podman@podhost.zenmo.com:~ /.config/containers/systemd/
18+
19+ # Restart services
20+ ssh podman@podhost.zenmo.com " \
21+ systemctl --user daemon-reload \
22+ && systemctl --user restart coco-frontend"
You can’t perform that action at this time.
0 commit comments