Merge pull request #318 from mlibrary/WEBSITE-134-adjust-colors-for-i… #336
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 of workflow | |
name: Staging workflow | |
# When workflow is triggered | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
# Jobs to carry out | |
jobs: | |
build: | |
# Operating system to run job on | |
runs-on: ubuntu-latest | |
# Environment to run job on | |
environment: staging | |
# Environment variables | |
env: | |
DRUPAL_CONCURRENT_FILE_REQUESTS: 20 | |
DRUPAL_REQUEST_TIMEOUT: 6000000 | |
DRUPAL_URL: ${{ vars.DRUPAL_URL }} | |
# Steps in job | |
steps: | |
# Get code from repo | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# Install NodeJS | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
# Enabling cache | |
- name: Caching Gatsby | |
id: gatsby-cache-build | |
uses: actions/cache@v4 | |
with: | |
path: | | |
public | |
.cache | |
key: ${{ runner.os }}-gatsby-build-${{ github.run_id }} | |
restore-keys: | | |
${{ runner.os }}-gatsby-build- | |
# Run npm install and build on our code | |
- run: npm install | |
- run: npm run build | |
# Deploy to Netlify using our production secrets | |
- name: Deploy to netlify | |
run: npx netlify-cli deploy --dir=public --prod | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ vars.NETLIFY_SITE_ID }} | |
- name: Output summary | |
run: echo "https://staging.lib.umich.edu" >> $GITHUB_STEP_SUMMARY | |
# Notify Slack if build fails | |
- name: Send custom JSON data to Slack workflow | |
if: ${{ failure() }} | |
uses: slackapi/[email protected] | |
with: | |
payload: | | |
{ | |
"url": "https://github.com/mlibrary/lib.umich.edu/actions/runs/${{ github.run_id }}", | |
"message": "Staging build and deploy failed" | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} |