Files
PunktFri/.gitea/workflows/deploy.yml
Henrik Jess Nielsen 347bbb748b
All checks were successful
Build and Deploy PunktFri / build-and-deploy (push) Successful in 1m20s
Update copy to post-July-2026 reality and notify on signups
- Rewrite copy from "this will happen" to "this has happened": direct
  registration closed 1 July 2026, transition ends 30 June 2028
- Fix timeline (30 June 2028, not 1 July), update FAQ + JSON-LD, add FAQ
  on registering new domains now
- Send signup notification mail to henrik@i80.dk via smtp.i80.dk, with
  credentials from Consul KV
- Fix CI health check URL (punktfri.dk)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-19 06:52:45 +02:00

73 lines
2.1 KiB
YAML

name: Build and Deploy PunktFri
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: debian-host
env:
PATH: /usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/bin:/snap/bin
DOCKER_HOST: unix:///var/run/docker.sock
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Verify Docker
run: docker --version
- name: Log in to Harbor Registry
run: |
echo "${{ secrets.HARBOR_ROBOT_TOKEN }}" | docker login registry.i80.dk -u "robot\$gitserver" --password-stdin
- name: Build and push Docker image
run: |
docker build \
--build-arg BUILD_VERSION=${{ github.ref_name }}-${{ github.sha }} \
--build-arg GIT_COMMIT=${{ github.sha }} \
--build-arg BUILD_TIME=${{ github.event.head_commit.timestamp }} \
-t registry.i80.dk/gitea/punktfri:latest \
-t registry.i80.dk/gitea/punktfri:${{ github.sha }} \
-f ./Dockerfile \
.
docker push registry.i80.dk/gitea/punktfri:latest
docker push registry.i80.dk/gitea/punktfri:${{ github.sha }}
- name: Validate Nomad job
run: nomad job validate punktfri.nomad
env:
NOMAD_ADDR: "https://nomad.i80.dk:4646"
- name: Deploy to Nomad
run: |
# Inject the specific image SHA so Nomad always sees a change
sed -i "s|registry.i80.dk/gitea/punktfri:latest|registry.i80.dk/gitea/punktfri:${{ github.sha }}|g" punktfri.nomad
nomad job run -detach=false punktfri.nomad
env:
NOMAD_ADDR: "https://nomad.i80.dk:4646"
- name: Wait for deployment
run: |
sleep 15
nomad job status punktfri
echo "=== Allocations ==="
nomad job allocs punktfri
env:
NOMAD_ADDR: "https://nomad.i80.dk:4646"
- name: Health check
run: |
sleep 20
curl -f https://punktfri.dk/health || echo "Service not yet available"
- name: Notify deployment status
run: |
echo "Deployment completed!"
echo "Service: https://punktfri.dk"
echo "Health: https://punktfri.dk/health"