Build and Deploy #39
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: Build and Deploy | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 0 * * 0" # every week | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # Fetch all history for all tags and branches | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: "1.22" | |
- name: Run sitegen | |
working-directory: tools/sitegen | |
env: | |
XBAR_GITHUB_ACCESS_TOKEN: ${{ secrets.XBAR_GITHUB_ACCESS_TOKEN }} | |
run: ./run.sh -skipdata | |
- name: Auth with Google Cloud | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: ${{ secrets.GCP_CREDENTIALS }} | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v2 | |
with: | |
version: ">= 363.0.0" | |
- name: Deploy to Google App Engine | |
working-directory: xbarapp.com | |
env: | |
GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }} | |
run: | | |
VERSION=$(date +%Y%m%d%H%M%S) | |
gcloud app deploy --project xbarapp --version $VERSION --quiet --verbosity=debug |