File tree Expand file tree Collapse file tree 4 files changed +87
-3
lines changed
Expand file tree Collapse file tree 4 files changed +87
-3
lines changed Original file line number Diff line number Diff line change 11name : CI
22on : [push]
33jobs :
4- publish-hidora :
5- name : Deploy to Docker Hub & Scaleway
4+ deploy :
5+ name : Publish container and deploy
66 if : github.event_name != 'pull_request'
77 runs-on : ubuntu-latest
88 permissions :
4747 labels : ${{ steps.meta.outputs.labels }}
4848 build-args : VERSION=${{ github.sha }}
4949
50- - name : Redeploy container
50+ - name : Configure Kubectl
51+ run : |
52+ kubectl config set-cluster scw-cluster \
53+ --server="${{ vars.K8S_SERVER_ADDRESS }}" \
54+ --certificate-authority=<(echo "${{ vars.K8S_CA_CERT }}" | base64 -d) \
55+ --embed-certs=true
56+
57+ kubectl config set-credentials deployer --token="${{ secrets.K8S_DEPLOY_TOKEN }}"
58+
59+ kubectl config set-context default --cluster=scw-cluster --user=deployer
60+ kubectl config use-context default
61+
62+ - name : Deploy to Kubernetes
63+ run : |
64+ sed "s|/anonymizing-reverse-proxy:latest|/anonymizing-reverse-proxy:sha-${GITHUB_SHA::7}|g" deploy/deployment.yaml | \
65+ kubectl apply -f - \
66+ -f deploy/service.yaml \
67+ -f deploy/routes.yaml
68+
69+ - name : Redeploy SCW container
5170 uses : httptoolkit/scaleway-serverless-container-deploy-action@v1
5271 with :
5372 container_id : ${{ vars.SCW_API_CONTAINER_ID }}
Original file line number Diff line number Diff line change 1+ apiVersion : apps/v1
2+ kind : Deployment
3+ metadata :
4+ name : anonymizing-reverse-proxy
5+ namespace : anonymizing-reverse-proxy
6+ spec :
7+ replicas : 1
8+ selector :
9+ matchLabels :
10+ app : anonymizing-reverse-proxy
11+ template :
12+ metadata :
13+ labels :
14+ app : anonymizing-reverse-proxy
15+ spec :
16+ containers :
17+ - name : server
18+ image : ghcr.io/httptoolkit/anonymizing-reverse-proxy:latest # GHA replaces :latest on build
19+ ports :
20+ - containerPort : 4000
21+ env :
22+ - name : ports
23+ value : " 4000"
24+ - name : ERRORS_DOMAIN
25+ value : " http://errors.httptoolkit.tech"
26+ - name : EVENTS_DOMAIN
27+ value : " http://events.httptoolkit.tech"
28+ - name : TRUSTED_PROXIES
29+ value : " 172.16.4.0/22"
Original file line number Diff line number Diff line change 1+ apiVersion : gateway.networking.k8s.io/v1
2+ kind : HTTPRoute
3+ metadata :
4+ name : anonymizing-reverse-proxy-route
5+ namespace : anonymizing-reverse-proxy
6+ spec :
7+ parentRefs :
8+ - name : primary-gateway
9+ namespace : gateway
10+ sectionName : https-httptoolkit-tech
11+ - name : secondary-gateway
12+ namespace : gateway
13+ sectionName : https-httptoolkit-tech
14+ hostnames :
15+ - " anonymizing-reverse-proxy.httptoolkit.tech"
16+ rules :
17+ - matches :
18+ - path :
19+ type : PathPrefix
20+ value : /
21+ backendRefs :
22+ - name : anonymizing-reverse-proxy
23+ port : 4000
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ kind : Service
3+ metadata :
4+ name : anonymizing-reverse-proxy
5+ namespace : anonymizing-reverse-proxy
6+ spec :
7+ selector :
8+ app : anonymizing-reverse-proxy
9+ ports :
10+ - name : http-port
11+ protocol : TCP
12+ port : 4000
13+ targetPort : 4000
You can’t perform that action at this time.
0 commit comments