From 4ea19a6041f746beadb8ce89fb9e1b9f02a7c471 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 8 Dec 2022 15:41:51 +0100 Subject: [PATCH] Add daily gallery build action (#14640) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Joakim Sørensen --- .github/workflows/gallery.yaml | 41 ++++++++++++++++++++++++++++ .github/workflows/netflify.yml | 3 -- gallery/script/netlify_build_gallery | 3 +- 3 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/gallery.yaml diff --git a/.github/workflows/gallery.yaml b/.github/workflows/gallery.yaml new file mode 100644 index 0000000000..9d50bbec0f --- /dev/null +++ b/.github/workflows/gallery.yaml @@ -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 }} diff --git a/.github/workflows/netflify.yml b/.github/workflows/netflify.yml index 51989057ba..64b70d7b04 100644 --- a/.github/workflows/netflify.yml +++ b/.github/workflows/netflify.yml @@ -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 }} diff --git a/gallery/script/netlify_build_gallery b/gallery/script/netlify_build_gallery index db8be615d1..97c95ebf2a 100755 --- a/gallery/script/netlify_build_gallery +++ b/gallery/script/netlify_build_gallery @@ -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