-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,123 @@ | ||
name: Build | ||
on: [push] | ||
name: Continuous Integration | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- main | ||
|
||
jobs: | ||
build: | ||
install-and-cache-deps: | ||
runs-on: ubuntu-latest | ||
env: | ||
CI_COMMIT_MESSAGE: Continuous Integration Build Project | ||
CI_COMMIT_AUTHOR: ${{ github.event.repository.name }} Continuous Integration | ||
steps: | ||
- name: Display event name | ||
run: echo "github.event_name=${{ github.event_name }}" | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Use Node.js 20 | ||
|
||
- name: Use Node version from .nvmrc | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- run: npm ci && npm run build && npm run lint | ||
node-version-file: '.nvmrc' | ||
|
||
- name: Cache NPM dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: ${{ runner.os }}-node- | ||
|
||
- name: Install dependencies | ||
run: npm ci --prefer-offline | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
needs: install-and-cache-deps | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache NPM dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: ${{ runner.os }}-node- | ||
|
||
- name: Lint project | ||
run: npm run lint | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
needs: install-and-cache-deps | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache NPM dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: ${{ runner.os }}-node- | ||
|
||
- name: Run unit tests | ||
run: npm run test:ci | ||
- name: Verify Changed files | ||
uses: tj-actions/verify-changed-files@v18 | ||
id: verify-changed-files | ||
|
||
build-doc: | ||
runs-on: ubuntu-latest | ||
needs: install-and-cache-deps | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache NPM dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
files: dist | ||
- name: Commit dist if changed | ||
if: env.CI_COMMIT_AUTHOR != 'auto' && github.event_name != 'pull_request' && contains(steps.verify-changed-files.outputs.changed_files, 'dist') | ||
path: node_modules | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: ${{ runner.os }}-node- | ||
|
||
- name: Build doc | ||
run: npm run build:doc | ||
|
||
build-and-commit-dist: | ||
runs-on: ubuntu-latest | ||
needs: [lint, test, build-doc] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache NPM dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: ${{ runner.os }}-node- | ||
|
||
- name: Build project | ||
run: npm run build | ||
|
||
- name: Setup git user | ||
run: | | ||
git config --global user.name "EDS CI/CD" | ||
git config --global user.email "[email protected]" | ||
- name: Add dist | ||
run: | | ||
git add -f ./dist | ||
git add -f ./types | ||
- name: Check if dist directory has changed | ||
id: check-dist-changes | ||
run: | | ||
before_commit="$github.event.before" | ||
if git diff --quiet HEAD "$before_commit" -- ./dist; then | ||
echo "No changes detected in the dist directory." | ||
else | ||
echo "dist_changed=true" >> "$GITHUB_ENV" | ||
fi | ||
- name: Commit and push dist | ||
if: steps.check-dist-changes.outputs.dist_changed == 'true' | ||
run: | | ||
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" | ||
git config --global user.email "[email protected]" | ||
git add . | ||
git commit -m "${{ env.CI_COMMIT_MESSAGE }}" | ||
git commit -m "Rebuild dist from CI" | ||
git push |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,11 @@ | |
coverage/* | ||
logs/* | ||
node_modules/* | ||
dist/* | ||
types/* | ||
|
||
helix-importer-ui | ||
.DS_Store | ||
*.bak | ||
.idea | ||
.idea | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npm run husky:pre-commit |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
src/styles/sass/base/*.scss | ||
src/styles/sass/components/*.scss | ||
src/styles/sass/layout/*.scss | ||
src/styles/sass/libs/*.scss |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,66 @@ | ||
# Your Project's Title... | ||
Your project's description... | ||
# Boilerplate for AEM Edge Delivery Services | ||
This is our Edge Delivery Services boilerplate. | ||
|
||
## Table of Contents | ||
- [Environments](#environments) | ||
- [Getting started](#getting-started) | ||
- [Prerequisites](#prerequisites) | ||
- [Installation](#installation) | ||
- [Linting](#linting) | ||
- [Documentation](#documentation) | ||
|
||
## Environments | ||
- Preview: [https://main--eds-editorial--ifahrentholz.hlx.page/](https://main--eds-editorial--ifahrentholz.hlx.page/) | ||
- Live: [https://main--eds-editorial--ifahrentholz.hlx.live/](https://main--eds-editorial--ifahrentholz.hlx.live/) | ||
|
||
## Installation | ||
### Prerequisites | ||
|
||
```sh | ||
npm i | ||
``` | ||
- GitHub account | ||
- Google or Microsoft account | ||
- npm | ||
```sh | ||
npm i | ||
``` | ||
|
||
### Installation | ||
|
||
1. Create your repository using the Boilerplate GitHub repository as a template: | ||
https://github.com/divae/boilerplate | ||
|
||
2. Add the AEM Code Sync GitHub App to the repository: | ||
https://github.com/apps/aem-code-sync/installations/new | ||
|
||
- Select `Only select Repositories` (not `All Repositories`). | ||
|
||
3. Link content source (Google Drive or Microsoft Sharepoint) | ||
- Create a folder in Google Drive/Sharepoint and share the folder with the Adobe Experience Manager user (`[email protected]`). | ||
- Change the reference in `fstab.yaml` in your GitHub repo to the Google Drive/Sharepoint folder URL and commit the changes. | ||
|
||
4. Install the Sidekick Chrome extension: | ||
https://chromewebstore.google.com/detail/aem-sidekick/ccfggkjabjahcjoljmgmklhpaccedipo?pli=1 | ||
|
||
- Go to the Google Drive/Sharepoint folder, click on the extension icon in the browser toolbar and select `Add this project`. | ||
- To preview and publish content, select a file in Google Drive/Sharepoint, click on the extension icon to open the new Sidekick Toolbar and click `preview` or `publish`. | ||
|
||
5. Start development | ||
- Install the AEM Command Line Interface (CLI) and clone your repo locally. | ||
``` | ||
npm install -g @adobe/aem-cli | ||
git clone https://github.com/<owner>/<repo> | ||
``` | ||
- Change into project folder and start your local dev environment. `npm start` initializes a build as well as runs the `aem up` command. | ||
``` | ||
cd <repo> | ||
npm start | ||
``` | ||
- Use Git to push code changes to your preview (https://<branch>--<repo>--<owner>.hlx.page/) and production (https://<branch>--<repo>--<owner>.hlx.live/) sites. | ||
## Linting | ||
```sh | ||
npm run lint | ||
``` | ||
|
||
## Local development | ||
## Documentation | ||
|
||
1. Create a new repository based on the `aem-boilerplate` template and add a mountpoint in the `fstab.yaml` | ||
1. Add the [AEM Code Sync GitHub App](https://github.com/apps/aem-code-sync) to the repository | ||
1. Install the [AEM CLI](https://github.com/adobe/aem-cli): `npm install -g @adobe/aem-cli` | ||
1. Start AEM Proxy: `aem up` (opens your browser at `http://localhost:3000`) | ||
1. Open the `{repo}` directory in your favorite IDE and start coding :) | ||
For more information, please refer to the <a href="https://github.com/ifahrentholz/eds-editorial/wiki">documentation</a>. |
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.
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.
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.
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.