upgrade CI to use TTT woodpecker

This commit is contained in:
Late Night Defender 2023-11-19 19:26:05 +07:00
parent 0714ddfe8f
commit dc812f58e1
3 changed files with 25 additions and 7 deletions

18
.woodpecker.yml Normal file
View file

@ -0,0 +1,18 @@
steps:
prepare:
image: bash
commands:
- systemctl --user stop ttt-org
- cp ttt-org.container ~/.config/containers/systemd
container-build:
image: bash
commands:
- sed -i "s/DATE/$(date -I)/g" index.html
- sed -i "s/VERSION/$(git log -1 --oneline | awk '{print $1}')/g" index.html
- podman build -t ttt-org .
container-deploy:
image: bash
commands:
- systemctl --user start ttt-org

View file

@ -1,10 +1,10 @@
systemctl --user stop ttt-org
podman rm ttt-org --force
sed -i "s/DATE/$(date -I)/g" index.html
sed -i "s/VERSION/$(git log -1 --oneline | awk '{print $1}')/g" index.html
podman build -t ttt-org .
cp ttt-org.container ~/.config/containers/systemd
systemctl --user daemon-reload
sed -i "s/DATE/$(date -I)/g" index.html
sed -i "s/VERSION/$(git log -1 --oneline | awk '{print $1}')/g" index.html
podman build -t ttt-org .
systemctl --user start ttt-org
podman run --name ttt-org -p 8084:80 -d ttt-org

View file

@ -4,7 +4,7 @@ Description=TechTransThai.org Website
[Container]
ContainerName=ttt-org
Image=ttt-org
PublishPort=8084:80
PublishPort=8089:80
[Service]
Restart=always