Skip to content

Build and Publish Site #1856

Build and Publish Site

Build and Publish Site #1856

name: Build and Publish Site
concurrency:
group: "build-and-publish"
cancel-in-progress: false
on:
schedule:
- cron: "0 12 * * *"
workflow_dispatch: {}
workflow_run:
workflows: [Deploy Infrastructure]
types:
- "completed"
jobs:
build-and-publish-site:
name: Build and Publish Site
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
outputs:
site_url: ${{ steps.build-and-publish.outputs.site_url }}
environment:
name: prod-site
url: ${{ steps.build-and-publish.outputs.site_url }}
permissions:
contents: "read"
id-token: "write"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup just
uses: extractions/setup-just@v1
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Utilize pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ env.pythonLocation }}-${{ hashFiles('events_page/requirements.txt') }}
- name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v0"
with:
workload_identity_provider: "projects/538480189659/locations/global/workloadIdentityPools/los-verdes-lv-event-pagenerator/providers/los-verdes-lv-event-pagenerator"
service_account: "site-publisher@losverdesatx-events.iam.gserviceaccount.com"
- name: Build and Publish Site
id: build-and-publish
run: just build-and-publish
- name: Echo site_url output
run: |
echo "site_url output: ${{ steps.build-and-publish.outputs.site_url }}"
run-browserstack-tests:
uses: los-verdes/lv-event-pagenerator/.github/workflows/run_browserstack_tests.yml@main
if: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' }}
needs: build-and-publish-site
with:
site_url: ${{ needs.build-and-publish-site.outputs.site_url }}
permissions:
contents: "read"
id-token: "write"
pull-requests: "write"
secrets:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
IMGUR_CLIENT_ID: ${{ secrets.IMGUR_CLIENT_ID }}