Skip to content

Deploy

Deploy #13

Workflow file for this run

name: Deploy
on:
workflow_dispatch:
schedule:
- cron: "30 11 * * *"
jobs:
Build:
runs-on: ubuntu-latest
env:
BUILD_DIR: /home/runner/work/build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: git clone main
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Google Authentication
uses: google-github-actions/auth@v2
id: auth
with:
token_format: "access_token"
project_id: 'obu-web-analytic-1724825889303'
service_account: "analyst@obu-web-analytic-1724825889303.iam.gserviceaccount.com"
workload_identity_provider: 'projects/927551777183/locations/global/workloadIdentityPools/github/providers/my-repo'
- name: Install requirements.txt
run: pip install -r requirements.txt
- name: Build the site
run: |
mkdir -p ${{ env.BUILD_DIR }}
cp -r public/* ${{ env.BUILD_DIR }}/
GA4_ACCESS_TOKEN='${{ steps.auth.outputs.access_token }}' GA4_PROPERTY_ID=${{ secrets.GA4_PROPERTY_ID }} python build.py --dest=${{ env.BUILD_DIR }}
- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ env.BUILD_DIR }}
- name: Deploy the Artifact to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4