-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from DHBW-FN-TIT20/KWYG-21-CI/CD-einrichten
KWYG 21 ci/cd einrichten
- Loading branch information
Showing
19 changed files
with
1,911 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node | ||
{ | ||
"name": "Node.js", | ||
"image": "mcr.microsoft.com/devcontainers/javascript-node:16-bullseye", | ||
"features": { | ||
"ghcr.io/devcontainers/features/git:1": {}, | ||
"ghcr.io/devcontainers/features/github-cli:1": {} | ||
}, | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [ | ||
3000 | ||
], | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "npm install -g [email protected] && npm install", | ||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
"remoteUser": "root", | ||
// Add extensions | ||
"extensions": [ | ||
"mhutchie.git-graph", | ||
"donjayamanne.githistory", | ||
"Gruntfuggly.todo-tree", | ||
"GitHub.copilot", | ||
"GitHub.vscode-pull-request-github", | ||
"esbenp.prettier-vscode" | ||
], | ||
"settings": { | ||
"[javascript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"editor.indentSize": "tabSize", | ||
"editor.tabSize": 2 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:react/recommended" | ||
], | ||
"overrides": [], | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"react" | ||
], | ||
"rules": { | ||
"max-len": [ | ||
"error", | ||
{ | ||
"code": 120 | ||
} | ||
], | ||
"react/prop-types": "off" | ||
}, | ||
"ignorePatterns": [ | ||
"src/**/*.test.js", | ||
"src/fonts/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Deploy App in GitHub Pages and create realse | ||
|
||
|
||
name: New Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
tags: | ||
- v*.*.* | ||
|
||
jobs: | ||
# Validate the code | ||
call-workflow-2-in-local-repo: | ||
uses: ./.github/workflows/validate_pr.yml | ||
|
||
# Build the App | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: 'npm' | ||
|
||
- name: Install packages | ||
run: npm ci | ||
|
||
- name: Run Tests | ||
run: npm test --if-present | ||
|
||
- name: Build app | ||
run: npm run build | ||
|
||
- name: Archive Release | ||
uses: thedoctor0/zip-release@main | ||
with: | ||
type: 'zip' | ||
directory: 'www' | ||
filename: ${{ env.GIT_TAG_NAME }}.zip | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@main | ||
with: | ||
name: github-pages | ||
path: ${{ env.GIT_TAG_NAME }}.zip | ||
retention-days: ${{ inputs.retention-days }} | ||
|
||
# Create Release | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
|
||
steps: | ||
- name: Download build | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: github-pages | ||
|
||
- name: Create release | ||
uses: marvinpinto/action-automatic-releases@latest | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
prerelease: false | ||
files: | | ||
${{ env.GIT_TAG_NAME }}.zip | ||
# Deploy on GitHub Pages | ||
GitHubPages: | ||
|
||
runs-on: ubuntu-latest | ||
needs: [build] | ||
|
||
steps: | ||
- name: Download build | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: github-pages | ||
|
||
- name: Unzip Data | ||
uses: montudor/action-zip@v1 | ||
with: | ||
args: unzip -qq ${{ env.GIT_TAG_NAME }}.zip -d www | ||
|
||
- name: Deploy 🚀 | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: www |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Validate the PR to the Sprint branches | ||
|
||
name: Check PR for valid code | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- '*Sprint*' | ||
workflow_call: | ||
|
||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm run lint-check-all | ||
- run: npm run prettier-check-all | ||
- run: npm run build --if-present | ||
- run: npm test --if-present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npm run check-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"src/**/*.{js,jsx,json,css,html}": [ | ||
"prettier --write" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Ignore fonts | ||
src/fonts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"printWidth": 120, | ||
"trailingComma": "all", | ||
"useTabs": false, | ||
"tabWidth": 2, | ||
"semi": true, | ||
"arrowParens": "avoid" | ||
} |
Oops, something went wrong.