From 08f369dfa572b37d84f789709aa766730e1335bf Mon Sep 17 00:00:00 2001 From: Max Ostapenko <1611259+max-ostapenko@users.noreply.github.com> Date: Sat, 4 Apr 2026 23:42:12 +0200 Subject: [PATCH] Add GitHub Actions workflow for deploying to Google App Engine --- .github/workflows/deploy.yml | 58 ++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..c30fdd15 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,58 @@ +###################################### +## Custom HTTP Archive GitHub action ## +###################################### +# +# Deploys the website to Google App Engine (production) on every push to main. +# Requires a GCP service account key stored as the GCP_SA_KEY repository secret. +# +name: Deploy to Production + +on: + push: + branches: + - main + +jobs: + deploy: + name: Build and Deploy to App Engine + runs-on: ubuntu-latest + if: github.repository == 'HTTPArchive/httparchive.org' + steps: + - name: Checkout branch + uses: actions/checkout@v6 + + - name: Setup Node.js for use with actions + uses: actions/setup-node@v6 + with: + node-version: '24' + + - name: Set up Python 3.14 + uses: actions/setup-python@v6 + with: + python-version: '3.14' + + - name: Install Node dependencies + run: npm install + + - name: Install Python dependencies + run: pip install -r requirements.txt + + - name: Build static assets + run: npm run build + + - name: Update timestamps + run: npm run timestamps + + - name: Generate scripts + run: npm run generate + + - name: Authenticate to Google Cloud + uses: google-github-actions/auth@v3 + with: + credentials_json: ${{ secrets.GCP_SA_KEY }} + + - name: Set up Cloud SDK + uses: google-github-actions/setup-gcloud@v2 + + - name: Deploy to App Engine + run: echo "Y" | gcloud app deploy --project httparchive