Skip to content

Commit a068378

Browse files
authored
Merge pull request #79 from zerotier/cache-and-automation
set up automated deployment
2 parents 29dbd2d + 41b16eb commit a068378

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

.github/workflows/deploy.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Deploy to install.zerotier.com
2+
on:
3+
release:
4+
types: [published]
5+
6+
concurrency:
7+
group: install-deploy
8+
9+
jobs:
10+
build:
11+
name: Depoy to install.zerotier.com
12+
13+
runs-on: gha-runner-x64
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Authenticate with Google Cloud
18+
id: auth
19+
uses: google-github-actions/auth@v2
20+
with:
21+
credentials_json: '${{ secrets.DOCKER_REGISTRY_WRITER }}'
22+
- name: Build and push Docker image
23+
run: |
24+
gcloud auth configure-docker us-central1-docker.pkg.dev
25+
docker build -t ${{ secrets.DOCKER_REGISTRY }}/install-zerotier-com:${{ github.ref_name }} . --push
26+
- name: Create Deploy PR
27+
run: |
28+
curl -s -L -X POST -H 'Accept: application/vnd.github+json' -H 'Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}' -H 'X-GitHub-Api-Version: 2022-11-28' https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d '{"event_type": "deploy_install_zerotier_com", "client_payload": {"docker_tag": "${{ github.ref_name }}", "actor": "${{ github.actor }}"}}'

default.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,12 @@ server {
44
server_name install.zerotier.com;
55
root /usr/share/nginx/html;
66
index install.sh;
7+
8+
location ~* \.(sh)$ {
9+
add_header Last-Modified $date_gmt;
10+
add_header Cache-Control 'public, max-age=86400';
11+
add_header X-Frame-Options "SAMEORIGIN" always;
12+
if_modified_since before;
13+
etag on;
14+
}
715
}

0 commit comments

Comments
 (0)