Skip to content

Commit 54e43ae

Browse files
Merge pull request #6 from silverstripeltd/task/update-workflow
Fix the broken Github Actions workflow
2 parents 2601565 + 2617e2e commit 54e43ae

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,39 @@
1-
# This is a basic workflow to help you get started with Actions
21
name: Deploy
32
on:
43
push:
54
branches: [master]
65
schedule:
76
- cron: '0 0 * * *'
87

9-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
108
jobs:
11-
# This workflow contains a single job called "build"
129
build:
1310
# The type of runner that the job will run on
1411
runs-on: ubuntu-latest
1512

16-
# Steps represent a sequence of tasks that will be executed as part of the job
1713
steps:
18-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
19-
- uses: actions/checkout@v2
20-
- uses: actions/setup-node@v2
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
2121
with:
2222
node-version: '18'
23-
- uses: nanasess/setup-php@master
23+
24+
- name: Setup PHP
25+
uses: nanasess/setup-php@master
2426
with:
2527
php-version: '8.1'
2628

2729
- name: Get Composer
2830
run: bash get_composer.bash
2931

30-
# Runs a single command using the runners shell
3132
- name: Build Pattern Library
3233
run: bash build_pattern_lib.bash
3334

3435
- name: Deploy 🚀
35-
uses: JamesIves/github-pages-deploy-action@4.1.3
36+
uses: JamesIves/github-pages-deploy-action@v4
3637
with:
3738
branch: gh-pages
3839
folder: storybook-static

build_pattern_lib.bash

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,17 @@ composer config allow-plugins.phpstan/extension-installer true
2020
../composer.phar require silverstripe/linkfield:4.x-dev --prefer-source --no-install
2121
../composer.phar require dnadesign/silverstripe-elemental:5.x-dev --prefer-source
2222
yarn cache clean
23-
yarn install
24-
yarn static-pattern-lib
23+
24+
# Retry Yarn install up to 3 times
25+
for i in {1..3}; do
26+
yarn install && break || sleep 10
27+
done
28+
29+
# Retry Yarn static-pattern-lib up to 3 times
30+
for i in {1..3}; do
31+
yarn static-pattern-lib && break || sleep 10
32+
done
33+
2534
mv storybook-static ../
2635
cd ..
2736
rm -rf silverstripe-admin

0 commit comments

Comments
 (0)