Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Deployment
on:
push:
branches:
- main
workflow_dispatch:
inputs:
env:
description: "Select environment to deploy to"
type: choice
required: true
default: "prod"
options:
- "prod"
- "stage & prod"
baseSha:
description: "Use base SHA commit to deploy from (empty string defaults to last commit before HEAD)"
type: string
required: false
default: ""
deployAll:
description: "Force deploy all files"
type: boolean
default: false
jobs:
deployment:
name: Deployment
uses: AdobeDocs/adp-devsite-workflow/.github/workflows/deploy.yml@main
with:
env: ${{ inputs.env || 'prod' }}
baseSha: ${{ inputs.baseSha || '' }}
deployAll: ${{ inputs.deployAll || true }}
17 changes: 17 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Lint
on:
pull_request:
branches: [main]
paths:
- 'src/pages/**'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Lint
run: npx --yes github:AdobeDocs/adp-devsite-utils runLint -v
148 changes: 21 additions & 127 deletions .github/workflows/stage.yml
Original file line number Diff line number Diff line change
@@ -1,128 +1,22 @@
---
name: Staging deployment
on:
workflow_dispatch:
inputs:
clean:
description: 'Clean cache (yes|no)'
required: true
default: 'yes'
excludeSubfolder:
description: 'Exclude a subfolder from deletion'
required: false
default: ''
jobs:
set-state:
runs-on: ubuntu-latest
outputs:
clean_cache: ${{ contains(github.event.inputs.clean, 'yes') }}
path_prefix: ${{ steps.get_path_prefix.outputs.path_prefix }}
branch_short_ref: ${{ steps.get_branch.outputs.branch }}
exclude_subfolder: ${{ github.event.inputs.excludeSubfolder }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get pathPrefix
uses: actions/github-script@v7
id: get_path_prefix
with:
script: |
const script = require('./.github/scripts/get-path-prefix.js');
script({ core });
result-encoding: string
- name: Get branch name
shell: bash
run: echo "branch=${GITHUB_REF#refs/heads/}" >> "$GITHUB_OUTPUT"
id: get_branch

echo-state:
needs: [set-state]
runs-on: ubuntu-latest
steps:
- run: echo "Clean cache - ${{ needs.set-state.outputs.clean_cache }}"
- run: echo "Repository org - ${{ github.event.repository.owner.login }}"
- run: echo "Repository name - ${{ github.event.repository.name }}"
- run: echo "Repository branch - ${{ needs.set-state.outputs.branch_short_ref }}"
- run: echo "Path prefix - ${{ needs.set-state.outputs.path_prefix }}"
- run: echo "Exclude subfolder - ${{ needs.set-state.outputs.exclude_subfolder }}"

pre-build:
needs: [set-state]
runs-on: ubuntu-latest
steps:
- name: check dev azure connection string
if: env.AIO_AZURE_DEV_CONNECTION_STRING == null
run: |
echo "::error::Please set the Azure Blob Storage connection string as AIO_AZURE_DEV_CONNECTION_STRING in Github Secrets"
exit 1
env:
AIO_AZURE_DEV_CONNECTION_STRING: ${{ secrets.AIO_AZURE_DEV_CONNECTION_STRING }}

build:
defaults:
run:
shell: bash
needs: [set-state, pre-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Setup Node and Install Dependencies Action
uses: commerce-docs/devsite-install-action@main
with:
node-version-file: '.nvmrc'
cache-dependency-path: 'yarn.lock'

- name: Gatsby Cache
uses: actions/cache@v4
with:
path: |
public
.cache
key: ${{ needs.set-state.outputs.branch_short_ref }}-gatsby-cache-${{ github.run_id }}
restore-keys: |
${{ needs.set-state.outputs.branch_short_ref }}-gatsby-cache-

- name: Clean Cache
if: needs.set-state.outputs.clean_cache == 'true'
run: yarn clean

- name: Build site
run: yarn build
env:
PREFIX_PATHS: true # equivalent to --prefix-paths flag for 'gatsby build'
PATH_PREFIX: ${{ needs.set-state.outputs.path_prefix }}
GATSBY_ADOBE_LAUNCH_SRC: ${{ secrets.AIO_ADOBE_LAUNCH_DEV_SRC }}
GATSBY_ADDITIONAL_ADOBE_ANALYTICS_ACCOUNTS: ${{ secrets.AIO_REPORT_SUITE_DEV}}
GATSBY_ADOBE_ANALYTICS_ENV: 'dev'
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_OWNER: ${{ github.event.repository.owner.login }}
REPO_NAME: ${{ github.event.repository.name }}
REPO_BRANCH: ${{ needs.set-state.outputs.branch_short_ref }}
GOOGLE_OAUTH_CLIENT_ID: ${{ secrets.GOOGLE_OAUTH_CLIENT_ID }}
GOOGLE_OAUTH_CLIENT_SECRET: ${{ secrets.GOOGLE_OAUTH_CLIENT_SECRET }}
GOOGLE_DOCS_TOKEN: ${{ secrets.GOOGLE_DOCS_TOKEN }}
GOOGLE_DOCS_FOLDER_ID: ${{ secrets.GOOGLE_DOCS_FOLDER_ID }}
GATSBY_IMS_SRC: ${{ secrets.AIO_IMS_DEV_SRC }}
GATSBY_IMS_CONFIG: ${{ secrets.AIO_IMS_DEV_CONFIG }}
GATSBY_ALGOLIA_APPLICATION_ID: ${{ secrets.AIO_ALGOLIA_APPLICATION_ID }}
GATSBY_ALGOLIA_SEARCH_API_KEY: ${{ secrets.AIO_ALGOLIA_SEARCH_API_KEY }}
ALGOLIA_INDEXATION_MODE: skip
GATSBY_ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME || github.event.repository.name }}
GATSBY_FEDS_PRIVACY_ID: ${{ secrets.AIO_FEDS_PRIVACY_ID }}
GATSBY_SITE_DOMAIN_URL: https://developer-stage.adobe.com

- name: Deploy
uses: AdobeDocs/static-website-deploy@master
with:
enabled-static-website: 'true'
source: 'public'
target: ${{ needs.set-state.outputs.path_prefix }}
connection-string: ${{ secrets.AIO_AZURE_DEV_CONNECTION_STRING }}
remove-existing-files: 'true'
exclude-subfolder: ${{ needs.set-state.outputs.exclude_subfolder }}
- name: Purge Fastly Cache
uses: AdobeDocs/gatsby-fastly-purge-action@master
with:
fastly-token: ${{ secrets.AIO_FASTLY_TOKEN }}
fastly-url: '${{ secrets.AIO_FASTLY_DEV_URL}}${{ needs.set-state.outputs.path_prefix }}'
name: Staging
on:
workflow_dispatch:
inputs:
baseSha:
description: "Use base SHA commit to deploy from (empty string defaults to last commit before HEAD)"
type: string
required: false
default: ""
deployAll:
description: "Force deploy all files"
type: boolean
default: false
jobs:
deployment:
name: Deployment
uses: AdobeDocs/adp-devsite-workflow/.github/workflows/deploy.yml@main
with:
env: stage
baseSha: ${{ inputs.baseSha }}
deployAll: ${{ inputs.deployAll }}
8 changes: 0 additions & 8 deletions .remarkrc.yml

This file was deleted.

Loading