Add daily gallery build action (#14640)

Co-authored-by: Joakim Sørensen <ludeeus@ludeeus.dev>
This commit is contained in:
Bram Kragten 2022-12-08 15:41:51 +01:00 committed by GitHub
parent 2b5ef1207c
commit 4ea19a6041
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 5 deletions

41
.github/workflows/gallery.yaml vendored Normal file
View File

@ -0,0 +1,41 @@
name: Gallery
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
env:
NODE_VERSION: 16
NODE_OPTIONS: --max_old_space_size=6144
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: Production
url: ${{ steps.deploy.outputs.NETLIFY_URL }}
steps:
- name: Check out files from GitHub
uses: actions/checkout@v3
- name: Set up Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
- name: Install dependencies
run: yarn install
env:
CI: true
- name: Build Gallery
run: ./node_modules/.bin/gulp build-gallery
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to Netlify
id: deploy
uses: netlify/actions/cli@master
with:
args: deploy --dir=gallery/dist --prod
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_GALLERY_SITE_ID }}

View File

@ -14,6 +14,3 @@ jobs:
- name: Trigger Demo build
run: curl -X POST -d {} https://api.netlify.com/build_hooks/${{ secrets.NETLIFY_DEMO_DEV_BUILD_HOOK }}
- name: Trigger Design build
run: curl -X POST -d "NIGHTLY" https://api.netlify.com/build_hooks/${{ secrets.NETLIFY_GALLERY_DEV_BUILD_HOOK }}

View File

@ -1,6 +1,7 @@
#!/bin/bash
TARGET_LABEL="needs design preview"
export SKIP_FETCH_NIGHTLY_TRANSLATIONS="true"
if [[ "$NETLIFY" != "true" ]]; then
echo "This script can only be run on Netlify"
@ -30,6 +31,4 @@ if [[ "${PULL_REQUEST}" == "true" ]]; then
else
createStatus "success" "Build was not requested by PR label"
fi
elif [[ "$INCOMING_HOOK_BODY" == "NIGHTLY" ]]; then
gulp build-gallery
fi