Skip to content

Commit

Permalink
Merge release into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Dec 16, 2024
2 parents 7914531 + be60746 commit 6893ea5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/fe_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ jobs:
server-token: 'local'
repo-token: ${{ secrets.GITHUB_TOKEN }}

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

- name: Publisher
uses: AmazeeLabs/publisher-action@4371b4a90a9fe2c86248e76c0f428e39abf6b610
with:
Expand All @@ -50,6 +43,13 @@ jobs:
apps/website/public
cache_key: 'fe-build-${{ inputs.env }}'

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

- name: Build & deploy
run: |
set -ex
Expand All @@ -68,10 +68,16 @@ jobs:
pnpm build:gatsby
fi
# "netlify deploy" fails to locate edge functions when executed from a
# monorepo. Flags like --cwd or --filter do not help. So we deploy the
# website app to a dedicated folder first.
pnpm deploy --filter "@custom/website" /tmp/deploy --prod
cd /tmp/deploy
# Deploy
pnpm netlify env:set AWS_LAMBDA_JS_RUNTIME nodejs18.x
pnpm netlify env:set DRUPAL_EXTERNAL_URL $DRUPAL_EXTERNAL_URL
pnpm netlify deploy --cwd=. --dir=apps/website/public --prodIfUnlocked
pnpm netlify deploy --prodIfUnlocked
# Report success to Publisher
echo "BUILD_IS_SUCCESSFUL=1" >> $GITHUB_ENV
Expand Down
5 changes: 5 additions & 0 deletions .lagoon/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,9 @@ RUN npm install -g [email protected]

COPY --from=builder /tmp/.deploy/publisher /app

# Decap config.
ENV VITE_DECAP_REPO='AmazeeLabs/silverback-template'
ARG LAGOON_GIT_BRANCH
ENV VITE_DECAP_BRANCH="$LAGOON_GIT_BRANCH"

CMD pnpm publisher
2 changes: 2 additions & 0 deletions apps/publisher/publisher.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ function githubEnvVars(): Record<string, string> {
'PUBLISHER_OAUTH2_SESSION_SECRET',
'PUBLISHER_OAUTH2_ENVIRONMENT_TYPE',
'PUBLISHER_OAUTH2_TOKEN_HOST',
'VITE_DECAP_REPO',
'VITE_DECAP_BRANCH',
].map((name) => {
if (name === 'DRUPAL_INTERNAL_URL') {
// No internal URLs when building on Github.
Expand Down
3 changes: 2 additions & 1 deletion apps/website/netlify/functions/github-proxy.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { githubProxy } from '@amazeelabs/decap-cms-backend-token-auth/proxy';
import type { Context } from '@netlify/functions';

import { githubProxy } from '../../node_modules/@amazeelabs/decap-cms-backend-token-auth/build/proxy.js';

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export default function (request: Request, context: Context) {
if (!process.env.DECAP_GITHUB_TOKEN) {
Expand Down

0 comments on commit 6893ea5

Please sign in to comment.