Website Release #1325
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: Website Release | |
# Performs a Website release using Netlify when a new GitHub release has been published | |
on: | |
# push: | |
# tags: | |
# - production | |
schedule: | |
- cron: '00 8,20 * * *' # 8,20 UTC = noon and midnight PST, 1am and 1pm PDT | |
jobs: | |
nuxt-prod: | |
name: Netlify deploy | |
runs-on: ubuntu-latest | |
# timeout-minutes: 50 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: production | |
- uses: ./.github/workflows/setup-workspace | |
# Step to generate the current date and time | |
- name: Set deployment date | |
id: set-deploy-date | |
run: echo "DEPLOY_DATE=$(date '+%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_ENV | |
- run: pnpm run generate | |
env: | |
CRAFT_ENDPOINT: ${{ secrets.CRAFT_PROD_ENDPOINT }} | |
LIBCAL_ENDPOINT: ${{ secrets.LIBCAL_ENDPOINT }} | |
S3_BUCKET: 'https://static.library.ucla.edu/' | |
SITEMAP_HOST: ${{ secrets.SITEMAP_URL_PROD }} | |
ES_URL: ${{ secrets.ES_URL }} | |
ESApiKey: ${{ secrets.ESApiKey }} | |
ES_READ_KEY: ${{ secrets.ES_READ_KEY_PROD }} | |
ES_WRITE_KEY: ${{ secrets.ES_WRITE_KEY_PROD }} | |
ES_ALIAS: ${{ secrets.ES_ALIAS_PROD }} | |
ES_INDEX_PREFIX: ${{ secrets.ES_INDEX_PREFIX_PROD }} | |
ES_TEMP_INDEX_PREFIX_LIBGUIDES: ${{secrets.ES_TEMP_INDEX_PREFIX_LIBGUIDES_PROD}} | |
LIBGUIDES_ES_INDEX: ${{secrets.LIBGUIDES_ES_INDEX_PROD}} | |
- name: Deploy to Netlify on release | |
uses: nwtgck/actions-netlify@v3 | |
with: | |
production-deploy: true | |
deploy-message: "Scheduled deployment on ${{ env.DEPLOY_DATE }}" | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
publish-dir: .output/public | |
fails-without-credentials: true | |
github-deployment-environment: production | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_PROD_LIBRARY_SITE_ID }} | |