Deploy #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "30 11 * * *" | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
env: | |
BUILD_DIR: /home/runner/work/build | |
steps: | |
- name: git clone main | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install requirements.txt | |
run: pip install -r requirements.txt | |
- name: Build the site | |
run: | | |
printf '${{ secrets.SERVICE_ACCOUNT_KEY }}' > "$HOME/gtoken.json" | |
export GOOGLE_APPLICATION_CREDENTIALS="$HOME/gtoken.json" | |
export GA4_PROPERTY_ID=${{ secrets.GA4_PROPERTY_ID }} | |
mkdir -p ${{ env.BUILD_DIR }} | |
cp -r public/* ${{ env.BUILD_DIR }}/ | |
python build.py --dest=${{ env.BUILD_DIR }} | |
- name: Upload Build Artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ${{ env.BUILD_DIR }} | |
Deploy: | |
runs-on: ubuntu-latest | |
needs: Build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy the Artifact to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |