Skip to content

Commit

Permalink
Merge pull request #79 from zerotier/cache-and-automation
Browse files Browse the repository at this point in the history
set up automated deployment
  • Loading branch information
glimberg authored Aug 28, 2024
2 parents 29dbd2d + 41b16eb commit a068378
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy to install.zerotier.com
on:
release:
types: [published]

concurrency:
group: install-deploy

jobs:
build:
name: Depoy to install.zerotier.com

runs-on: gha-runner-x64

steps:
- uses: actions/checkout@v4
- name: Authenticate with Google Cloud
id: auth
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.DOCKER_REGISTRY_WRITER }}'
- name: Build and push Docker image
run: |
gcloud auth configure-docker us-central1-docker.pkg.dev
docker build -t ${{ secrets.DOCKER_REGISTRY }}/install-zerotier-com:${{ github.ref_name }} . --push
- name: Create Deploy PR
run: |
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 }}"}}'
8 changes: 8 additions & 0 deletions default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ server {
server_name install.zerotier.com;
root /usr/share/nginx/html;
index install.sh;

location ~* \.(sh)$ {
add_header Last-Modified $date_gmt;
add_header Cache-Control 'public, max-age=86400';
add_header X-Frame-Options "SAMEORIGIN" always;
if_modified_since before;
etag on;
}
}

0 comments on commit a068378

Please sign in to comment.