Skip to content

Commit

Permalink
Merge pull request #185 from AmazeeLabs/SLB-308-cta-block-gutenberg
Browse files Browse the repository at this point in the history
SLB-313: dev
  • Loading branch information
chindris authored Apr 16, 2024
2 parents 0996d95 + 40eab14 commit 8ce8ec5
Show file tree
Hide file tree
Showing 153 changed files with 9,905 additions and 6,056 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Deploy
on:
push:
branches:
- prod
- dev

jobs:
test:
name: Deploy
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup
uses: ./.github/actions/setup

- run: pwd
working-directory: ${{ runner.home }}

- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Prepare deployment package
run: pnpm turbo:prep && pnpm deploy --filter "@custom/website" ../deploy --prod
env:
VITE_DECAP_REPO: ${{ github.repository }}
VITE_DECAP_BRANCH: ${{ steps.extract_branch.outputs.branch }}

- name: Build
run: pnpm run --filter @custom/website build
working-directory: ../deploy
env:
CLOUDINARY_API_KEY: ${{ vars.CLOUDINARY_API_KEY }}
CLOUDINARY_API_SECRET: ${{ secrets.CLOUDINARY_API_SECRET }}
CLOUDINARY_CLOUDNAME: ${{ secrets.CLOUDINARY_CLOUDNAME }}
GATSBY_PUBLIC_URL: ${{ vars.GATSBY_PUBLIC_URL }}

- name: Check for Netlify auth token
id: netlify-check
shell: bash
run: |
if [ "${{ secrets.NETLIFY_AUTH_TOKEN }}" != '' ]; then
echo "available=true" >> $GITHUB_OUTPUT;
else
echo "available=false" >> $GITHUB_OUTPUT;
fi
- name: Deploy to dev
run: pnpm netlify deploy --prod --filter "@custom/website"
working-directory: ../deploy
if: github.ref == 'refs/heads/dev' && steps.netlify-check.outputs.available == 'true' && vars.NETLIFY_DEV_ID != ''
env:
NETLIFY_SITE_ID: ${{ vars.NETLIFY_DEV_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}

- name: Deploy to prod
run: pnpm netlify deploy --prod --filter "@custom/website"
working-directory: ../deploy
if: github.ref == 'refs/heads/prod' && steps.netlify-check.outputs.available == 'true' && vars.NETLIFY_PROD_ID != ''
env:
NETLIFY_SITE_ID: ${{ vars.NETLIFY_PROD_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}

50 changes: 50 additions & 0 deletions .github/workflows/high_content_volume.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: High Content Volume
on:
workflow_dispatch:

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Setup
uses: ./.github/actions/setup

- name: TurboRepo local server
uses: felixmosh/turborepo-gh-artifacts@v2
with:
server-token: 'local'
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Prepare
run: pnpm turbo:prep
env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_TOKEN: 'local'
TURBO_TEAM: 'local'

- name: 'Drupal: Start'
run: pnpm --filter "@custom/cms" start &

- name: 'Gatsby: Clean'
run: pnpm --filter "@custom/website" clean

- name: 'Drupal: Create content'
run: pnpm --filter "@custom/cms" drush php:script scripts/create-lots-of-content/run.php

- name: 'Gatsby: Full build'
run: pnpm --filter "@custom/website" build:gatsby

- name: 'Gatsby: Incremental build without new content'
run: pnpm --filter "@custom/website" build:gatsby

- name: 'Drupal: Create more content'
run: pnpm --filter "@custom/cms" drush php:script scripts/create-lots-of-content/create-100-pages.php

- name: 'Gatsby: Incremental build with new content'
run: pnpm --filter "@custom/website" build:gatsby
11 changes: 11 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ jobs:
path: tests/e2e/playwright-report/
retention-days: 3

- name: Check for Chromatic project token
id: chromatic-check
shell: bash
run: |
if [ "${{ secrets.CHROMATIC_PROJECT_TOKEN }}" != '' ]; then
echo "available=true" >> $GITHUB_OUTPUT;
else
echo "available=false" >> $GITHUB_OUTPUT;
fi
- name: Publish to Chromatic
uses: chromaui/action@v1
with:
Expand All @@ -49,6 +59,7 @@ jobs:
storybookBaseDir: packages/ui
onlyChanged: true
exitOnceUploaded: true
if: ${{ steps.chromatic-check.outputs.available == 'true' }}

- name: Deploy storybook to netlify
run:
Expand Down
18 changes: 10 additions & 8 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
FROM gitpod/workspace-full

RUN bash -c 'VERSION="18.19.0" \
&& source $HOME/.nvm/nvm.sh && nvm install $VERSION \
&& nvm use $VERSION && nvm alias default $VERSION'

RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix

RUN sudo update-alternatives --set php $(which php8.2)
RUN sudo install-packages php8.2-gd php8.2-mbstring php8.2-curl php8.2-sqlite3 php8.2-zip php8.2-xdebug php8.2-imagick
RUN pnpx [email protected] install-deps
Expand All @@ -11,14 +18,9 @@ RUN /home/gitpod/.deno/bin/deno completions bash > /home/gitpod/.bashrc.d/90-den
echo 'export DENO_INSTALL="/home/gitpod/.deno"' >> /home/gitpod/.bashrc.d/90-deno && \
echo 'export PATH="$DENO_INSTALL/bin:$PATH"' >> /home/gitpod/.bashrc.d/90-deno

# Install neovim and helpers
RUN wget https://github.com/neovim/neovim/releases/download/v0.9.2/nvim-linux64.tar.gz && \
tar xzf nvim-linux64.tar.gz && \
sudo mv nvim-linux64 /usr/local/nvim && \
sudo ln -s /usr/local/nvim/bin/nvim /usr/local/bin/nvim && \
rm -rf nvim-linux64.tar.gz
RUN sudo apt-get install -y fd-find
RUN npm install -g neovim
RUN sudo add-apt-repository ppa:maveonair/helix-editor && \
sudo apt update && \
sudo apt install helix

# Install phpactor
RUN curl -Lo phpactor.phar https://github.com/phpactor/phpactor/releases/latest/download/phpactor.phar
Expand Down
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/silverback-template.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .lagoon/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ ENV WEBROOT=web
FROM uselagoon/nginx-drupal as nginx

COPY --from=cli /app /app
RUN cd /app/web && cp ../node_modules/@custom/ui/build/gutenberg.css .
COPY .lagoon/nginx-conf/redirects-map.conf /etc/nginx/redirects-map.conf

WORKDIR /app
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ _local
apps
packages
tests
.turbo
8 changes: 6 additions & 2 deletions INIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ replace(
'# ' + process.env.PROJECT_NAME_HUMAN,
);
replace(
'apps/cms/config/sync/system.site.yml',
[
'apps/cms/config/sync/system.site.yml',
'tests/schema/specs/content.spec.ts',
'tests/e2e/specs/drupal/metatags.spec.ts',
],
'Silverback Drupal Template',
process.env.PROJECT_NAME_HUMAN,
);
Expand Down Expand Up @@ -97,7 +101,7 @@ Update the auth key for Gatsby user.
```ts
const authKey = randomString(32);
replace(
'apps/website/gatsby-config.js',
'apps/cms/gatsby-config.mjs',
"auth_key: 'cfdb0555111c0f8924cecab028b53474'",
`auth_key: '${authKey}'`,
);
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,19 @@ Other steps
- [Create a new Lagoon project](https://amazeelabs.atlassian.net/wiki/spaces/ALU/pages/368115717/Create+a+new+Lagoon+project)
- [Create a new Netlify project](https://amazeelabs.atlassian.net/wiki/spaces/ALU/pages/368017428/Create+a+new+Netlify+project)
- Check the [Environment overrides](#environment-overrides) section below
- Check the [Choose a CMS](#choose-a-cms) section below
- Create `dev` and `prod` branches (and optionally `stage`) from `release`

## Choose a CMS

The template comes with Drupal and Decap CMS enabled by default. To disable
either (or both), follow these two steps:

1. Remove the dependencies to `@custom/cms`/`@custom/decap` from
`apps/website/package.json`
2. Remove the `@custom/cms`/`@custom/decap` plugins from
`apps/website/gatsby-config.mjs`

## Branches and environments

<table>
Expand Down
12 changes: 6 additions & 6 deletions apps/cms/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apps/cms/config/sync/config_ignore.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ _core:
mode: simple
ignored_config_entities:
- 'webform.webform*'
- ~webform.webform.inquiry
enable_export_filtering: true
Loading

0 comments on commit 8ce8ec5

Please sign in to comment.