chore(deps): bump decap-cms-app from 3.3.2 to 3.5.0 #4911
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: Monorepo Deploy Pipeline | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
schedule: | |
# Scheduled build so pipeline failures are noticed quicker. | |
- cron: "30 4 * * 1,3,5,0" | |
jobs: | |
prepare: | |
name: "Prepare (Find Projects, Warm dependency caches)" | |
runs-on: ubuntu-latest | |
outputs: | |
projects: ${{ steps.find-projects.outputs.projects }} | |
steps: | |
- uses: actions/checkout@main | |
with: | |
fetch-depth: 10 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 8 | |
run_install: false | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "pnpm" | |
- name: Install Dependencies | |
run: | | |
rm services/personal-website/package.json | |
pnpm install --ignore-scripts --prod=false | |
- id: find-projects | |
name: Find affected projects | |
run: | | |
lerna_args=() | |
lerna_args+=('--all') | |
lerna_args+=('--loglevel silent') | |
lerna_args+=('--ignore @alexwilson/personal-website') | |
# Lerna attempts to find any changed packages since the last update... | |
if [[ $(pnpx lerna list ${lerna_args[@]} --since $MAIN_BRANCH | head -c1 | wc -c) -ne 0 ]]; then | |
# If there are some, and this isn't a scheduled build, we prefer to test | |
# and deploy only the updated packages. | |
# Scheduled builds always update & deploy everything. | |
if [ $GITHUB_EVENT_NAME != 'schedule' ]; then | |
lerna_args+=("--since $MAIN_BRANCH") | |
fi | |
fi | |
# Finally - we're ready to output as JSON for JQ to consume | |
lerna_args+=('--json') | |
echo "Github Event: $GITHUB_EVENT_NAME" | |
echo "$ pnpx lerna list ${lerna_args[@]}" | |
echo "$ jq ${jq_args[@]}" | |
echo "$ echo projects=$( \ | |
pnpx lerna list ${lerna_args[@]} \ | |
| jq -rjc -n '.include |= inputs' \ | |
) >> \$GITHUB_OUTPUT" | |
echo "projects=$( \ | |
pnpx lerna list ${lerna_args[@]} \ | |
| jq -rjc -n '.include |= inputs' \ | |
)" >> $GITHUB_OUTPUT | |
env: | |
MAIN_BRANCH: "main" | |
# Fetch dependencies and build Gatsby | |
test: | |
needs: [prepare] | |
name: Test ${{ matrix.name }} | |
runs-on: ubuntu-latest | |
env: | |
NODE_ENV: ${{ secrets.NODE_ENV }} | |
strategy: | |
matrix: ${{ fromJson(needs.prepare.outputs.projects) }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
with: | |
fetch-depth: 1 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 8 | |
run_install: false | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "pnpm" | |
- name: Install Dependencies | |
run: | | |
rm services/personal-website/package.json | |
pnpm install --ignore-scripts --prod=false | |
- name: Test | |
run: pnpx lerna run test --scope ${{ matrix.name }} | |
tests-passed: | |
name: Tests Passed | |
needs: [test] | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "👍" | |
deploy: | |
strategy: | |
matrix: ${{ fromJson(needs.prepare.outputs.projects) }} | |
name: Deploy ${{ matrix.name }} | |
needs: [prepare, tests-passed] | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | |
env: | |
NODE_ENV: ${{ secrets.NODE_ENV }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
with: | |
fetch-depth: 1 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 8 | |
run_install: false | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "pnpm" | |
- name: Install Dependencies | |
run: | | |
rm services/personal-website/package.json | |
pnpm install --ignore-scripts --prod=false | |
- name: Deploy | |
run: pnpx lerna run deploy --scope ${{ matrix.name }} | |
env: | |
CI: true | |
CF_ZONE_ID: ${{ secrets.CF_ZONE_ID }} | |
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} | |
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: "eu-west-1" |