Skip to content
Closed
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
11 changes: 11 additions & 0 deletions .github/workflows/build-auto-generated-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Build Auto-Generated Files
on:
workflow_dispatch:

jobs:
build-contributors:
name: Build Auto-Generated Files
uses: AdobeDocs/adp-devsite-workflow/.github/workflows/build-auto-generated-files-v2.yml@main
secrets: inherit

35 changes: 35 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Production 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
if: github.actor != 'adp-devsite-app[bot]' && github.repository != 'AdobeDocs/dev-docs-template'
uses: AdobeDocs/adp-devsite-workflow/.github/workflows/deploy-v2.yml@main
secrets: inherit
with:
env: ${{ inputs.env || 'prod' }}
baseSha: ${{ inputs.baseSha || '' }}
deployAll: ${{ inputs.deployAll || false }}
45 changes: 45 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Lint
on:
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Check for src/pages changes
id: changes
run: |
git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -q '^src/pages/' \
&& echo "changed=true" >> $GITHUB_OUTPUT \
|| echo "changed=false" >> $GITHUB_OUTPUT

- name: Lint
id: lint
if: steps.changes.outputs.changed == 'true'
continue-on-error: true
run: npx --yes github:AdobeDocs/adp-devsite-utils runLint -v

- name: Save PR number
if: always()
run: echo "${{ github.event.pull_request.number }}" > pr-number.txt

- name: Upload linter report
if: always()
uses: actions/upload-artifact@v7
with:
name: linter-report
path: |
linter-report.txt
pr-number.txt
if-no-files-found: ignore

- name: Fail if linter found errors
if: steps.changes.outputs.changed == 'true' && steps.lint.outcome == 'failure'
run: exit 1
32 changes: 32 additions & 0 deletions .github/workflows/post-lint-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Post Linter Report
on:
workflow_run:
workflows: ["Lint"]
types:
- completed

permissions:
pull-requests: write

jobs:
comment:
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request'
steps:
- name: Download linter report artifact
uses: actions/download-artifact@v8
with:
name: linter-report
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Post Linter Report to PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
LINTER_REPORT_PATH: ./linter-report.txt
PR_NUMBER_PATH: ./pr-number.txt
run: |
npm install --no-save github:AdobeDocs/adp-devsite-scripts
node node_modules/adp-devsite-scripts/linter-bot/postLinterReport.js
23 changes: 23 additions & 0 deletions .github/workflows/stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
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-v2.yml@main
secrets: inherit
with:
env: stage
baseSha: ${{ inputs.baseSha }}
deployAll: ${{ inputs.deployAll }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,7 @@ Pods/
Carthage/Build/
*.ipa
*.dSYM.zip
*.dSYM
*.dSYM

# generated by .github/workflows/lint.yml
linter-report.txt
32 changes: 32 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "embed-sdk-samples",
"version": "1.0.0",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/AdobeDocs/embed-sdk-samples"
},
"author": {
"name": "Tim Kim",
"url": "https://github.com/timkim"
},
"engines": {
"node": "^24.11.0"
},
"scripts": {
"dev": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils dev",
"buildNavigation": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils buildNavigation -v",
"buildRedirections": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils buildRedirections -v",
"renameFiles": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils renameFiles -v",
"normalizeLinks": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils normalizeLinks -v",
"buildSiteWideBanner": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils buildSiteWideBanner -v",
"buildSiteMetadata": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils buildSiteMetadata -v",
"buildContributors": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils buildContributorsV2 -v",
"lint": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils runLint -v",
"lint:errorOnly": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils runLint",
"link:externalLinkOnly": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils runLint --external-links-only -v",
"link:checkAllLinks": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils runLint --internal-links-only --external-links-only -v",
"redirectCheck:stage": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils redirectChecker stage --verbose",
"redirectCheck:prod": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils redirectChecker prod --verbose"
}
}