chore: fix everything after merging release in #2959
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
workflow_dispatch: | |
inputs: | |
turborepo_caching: | |
description: 'Turborepo caching' | |
type: choice | |
options: | |
- 'On' | |
- 'Off' | |
default: 'On' | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Init check | |
if: ${{ github.repository != 'AmazeeLabs/silverback-template'}} | |
run: | |
echo 'Please run the INIT script. See the root README.md for | |
instructions.' && false | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup | |
uses: ./.github/actions/setup | |
- name: Check formatting | |
run: pnpm test:format | |
- name: TurboRepo local server | |
if: ${{ github.event.inputs.turborepo_caching != 'Off' }} | |
uses: felixmosh/turborepo-gh-artifacts@v2 | |
with: | |
server-token: 'local' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Test | |
run: pnpm turbo:test | |
env: | |
TURBO_API: 'http://127.0.0.1:9080' | |
TURBO_TOKEN: 'local' | |
TURBO_TEAM: 'local' | |
- name: 'Logs: cms' | |
run: cat /tmp/cms.log || true | |
if: always() | |
- name: 'Logs: website' | |
run: cat /tmp/website.log || true | |
if: always() | |
- name: 'Logs: preview' | |
run: cat /tmp/preview.log || true | |
if: always() | |
- name: Check for Chromatic Storybook project token | |
id: chromatic-storybook-check | |
shell: bash | |
run: | | |
if [ "${{ secrets.CHROMATIC_STORYBOOK_PROJECT_TOKEN }}" != '' ]; then | |
echo "available=true" >> $GITHUB_OUTPUT; | |
else | |
echo "available=false" >> $GITHUB_OUTPUT; | |
fi | |
- name: Check for Chromatic Playwright project token | |
id: chromatic-playwright-check | |
shell: bash | |
run: | | |
if [ "${{ secrets.CHROMATIC_PLAYWRIGHT_PROJECT_TOKEN }}" != '' ]; then | |
echo "available=true" >> $GITHUB_OUTPUT; | |
else | |
echo "available=false" >> $GITHUB_OUTPUT; | |
fi | |
- name: Publish Playwright to Chromatic | |
id: chromatic-playwright | |
uses: chromaui/action@latest | |
with: | |
playwright: true | |
projectToken: ${{ secrets.CHROMATIC_PLAYWRIGHT_PROJECT_TOKEN }} | |
workingDir: tests/e2e/ | |
if: | |
always() && hashFiles('tests/e2e/test-results') && | |
steps.chromatic-playwright-check.outputs.available == 'true' | |
- name: Publish Storybook to Chromatic | |
id: chromatic-storybook | |
uses: chromaui/action@latest | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
projectToken: ${{ secrets.CHROMATIC_STORYBOOK_PROJECT_TOKEN }} | |
storybookBuildDir: packages/ui/storybook-static | |
storybookBaseDir: packages/ui | |
onlyChanged: true | |
exitOnceUploaded: true | |
externals: | | |
static/stories/webforms/** | |
if: | |
${{ steps.chromatic-storybook-check.outputs.available == 'true' && | |
github.ref != 'refs/heads/dev' }} | |
- name: Deploy storybook to netlify | |
run: | |
pnpm run --filter=@custom/ui build && npx netlify-cli deploy --prod | |
--filter @custom/ui --dir=packages/ui/storybook-static | |
env: | |
VITEST_CLOUDINARY_CLOUDNAME: local | |
NETLIFY_SITE_ID: ${{ vars.NETLIFY_STORYBOOK_ID }} | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
if: | |
${{ github.ref == 'refs/heads/dev' && vars.NETLIFY_STORYBOOK_ID != '' | |
}} | |
- name: Merge release to prod (silverback-template only) | |
uses: devmasx/[email protected] | |
if: | |
${{ github.repository == 'AmazeeLabs/silverback-template' && | |
github.ref == 'refs/heads/release'}} | |
with: | |
type: now | |
from_branch: release | |
target_branch: prod | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
update_dashboard: | |
name: Update dashboard | |
if: github.ref == 'refs/heads/release' && vars.JIRA_PROJECT_ID != '' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install estimator | |
run: npm install -g @amazeelabs/estimator | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Update dashboard | |
env: | |
JIRA_PROJECT_ID: ${{ vars.JIRA_PROJECT_ID }} | |
DASHBOARD_ACCESS_TOKEN: ${{ secrets.DASHBOARD_ACCESS_TOKEN }} | |
run: amazeelabs-estimator update | |
init_script: | |
name: Init script | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup | |
uses: ./.github/actions/setup | |
- name: Test init script | |
run: | |
pnpm --filter @custom/init run init --project-human-name "Foo Bar" | |
--project-machine-name foo_bar | grep 'Run `pnpm i` to update the lock | |
file' | |
docker_build: | |
name: Docker Build | |
if: | |
startsWith(github.ref_name, 'test-all/') || startsWith(github.head_ref, | |
'test-all/') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2 | |
bundler-cache: true | |
- name: Install Pygmy | |
run: gem install pygmy | |
- name: Start Pygmy | |
run: pygmy up | |
- name: Docker Build & Up | |
run: DOCKER_BUILDKIT=1 docker-compose up -d --build | |
- name: Wait a bit | |
run: sleep 5 | |
- name: Check containers status | |
run: | | |
if docker-compose ps | grep Exit | |
then | |
echo "Docker container(s) exited" | |
exit 1 | |
else | |
echo "Docker containers running" | |
fi |