Skip to content

Commit

Permalink
Merge pull request #6 from silverstripeltd/task/update-workflow
Browse files Browse the repository at this point in the history
Fix the broken Github Actions workflow
  • Loading branch information
GuySartorelli authored Sep 18, 2024
2 parents 2601565 + 2617e2e commit 54e43ae
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
# This is a basic workflow to help you get started with Actions
name: Deploy
on:
push:
branches: [master]
schedule:
- cron: '0 0 * * *'

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

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- uses: nanasess/setup-php@master

- name: Setup PHP
uses: nanasess/setup-php@master
with:
php-version: '8.1'

- name: Get Composer
run: bash get_composer.bash

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

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.3
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: storybook-static
13 changes: 11 additions & 2 deletions build_pattern_lib.bash
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,17 @@ composer config allow-plugins.phpstan/extension-installer true
../composer.phar require silverstripe/linkfield:4.x-dev --prefer-source --no-install
../composer.phar require dnadesign/silverstripe-elemental:5.x-dev --prefer-source
yarn cache clean
yarn install
yarn static-pattern-lib

# Retry Yarn install up to 3 times
for i in {1..3}; do
yarn install && break || sleep 10
done

# Retry Yarn static-pattern-lib up to 3 times
for i in {1..3}; do
yarn static-pattern-lib && break || sleep 10
done

mv storybook-static ../
cd ..
rm -rf silverstripe-admin

0 comments on commit 54e43ae

Please sign in to comment.