Skip to content

Commit

Permalink
Periodic build for canary (#2408)
Browse files Browse the repository at this point in the history
Updated periodic-build for canary with yarn caching, corepack, and Node 18, 20, 22 support.

---------

Co-authored-by: Renzo van Hootegem <[email protected]>
Co-authored-by: Paul Hachmang <[email protected]>
  • Loading branch information
3 people authored Nov 15, 2024
1 parent 1b65a1c commit 0c7d5ea
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/periodic-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Periodic build
on:
schedule:
- cron: 0 0 * * *
push:
branches:
- 'canary'
concurrency:
group: release-canary
jobs:
notify-start:
name: Notify release start
uses: ho-nl/release-slack-action/.github/workflows/notify-slack-start.yml@main
secrets:
slackToken: ${{ secrets.SLACK_BOT_RELEASE_TOKEN }}
with:
channel: graphcommerce-build
message: Graphcommerce start building
notifyOnlyOnFailure: true
publish:
strategy:
matrix:
version: [18, 20, 22]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
path: graphcommerce

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
registry-url: 'https://registry.npmjs.org'
scope: 'graphcommerce'

- name: Prepare and build graphcommerce
run: |
cp -R graphcommerce/examples/magento-graphcms/. graphcommerce-build
cd graphcommerce-build
corepack enable
yarn
yarn codegen
yarn build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# notify-end will run only if any publish job failed
notify-end:
if: always()
needs: [notify-start, publish]
name: Notify release end
uses: ho-nl/release-slack-action/.github/workflows/notify-slack-end.yml@main
secrets:
slackToken: ${{ secrets.SLACK_BOT_RELEASE_TOKEN }}
with:
time: ${{ needs.notify-start.outputs.time }}
result: ${{ needs.publish.result }}
channel: graphcommerce-build
message: "One or more Node.js versions failed in the periodic build"
notifyOnlyOnFailure: true

0 comments on commit 0c7d5ea

Please sign in to comment.