From a1ab0e65b158acaa2ce94a7131b2a0a4f3f08366 Mon Sep 17 00:00:00 2001 From: Gene Kogan Date: Sun, 5 Nov 2023 14:46:59 +0100 Subject: [PATCH] pipeline --- .babelrc | 8 +++++ .eslintignore | 5 +++ .eslintrc.json | 59 +++++++++++++++++++++++++++++++++ .github/workflows/pipeline.yaml | 52 +++++++++++++++++++++++++++++ .gitignore | 24 ++++++++++++++ .prettierignore | 6 ++++ .prettierrc | 19 +++++++++++ .yarnrc | 1 + 8 files changed, 174 insertions(+) create mode 100644 .babelrc create mode 100644 .eslintignore create mode 100644 .eslintrc.json create mode 100644 .github/workflows/pipeline.yaml create mode 100644 .gitignore create mode 100644 .prettierignore create mode 100644 .prettierrc create mode 100644 .yarnrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..feac1de --- /dev/null +++ b/.babelrc @@ -0,0 +1,8 @@ +{ + "presets": [ + "next/babel" + ], + "plugins": [ + ["styled-components", { "ssr": true, "displayName": true }] + ] +} diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..bb31ff0 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,5 @@ +build +node_modules +.vscode +public/vendor +**/*.css \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..a3c017a --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,59 @@ +{ + "env": { + "node": true, + "browser": true, + "es2021": true + }, + "settings": { + "react": { + "version": "detect" + } + }, + "extends": [ + "eslint:recommended", + "plugin:react/recommended", + "plugin:@typescript-eslint/recommended", + "prettier" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": "latest", + "sourceType": "module" + }, + "plugins": ["react", "@typescript-eslint", "import", "react-hooks"], + "rules": { + "@typescript-eslint/no-non-null-assertion": "off", + "react/prop-types": "off", + "react/no-unescaped-entities": "off", + "react/react-in-jsx-scope": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + + "@typescript-eslint/no-var-requires": "warn", + + "react-hooks/exhaustive-deps": "error", + "@typescript-eslint/no-redeclare": "error", + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "typeLike", + "format": ["PascalCase"] + } + ], + "no-console": ["error", { "allow": ["warn", "error", "info"] }], + "no-restricted-imports": [ + "error", + { + "paths": [ + { + "name": "ethers", + "message": "Please import from '@ethersproject/module' directly to support tree-shaking." + } + ] + } + ] + } +} diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml new file mode 100644 index 0000000..cad14de --- /dev/null +++ b/.github/workflows/pipeline.yaml @@ -0,0 +1,52 @@ +name: 'Build and Deploy - Eden.art' + +on: + workflow_dispatch: + push: + branches: [main] + + pull_request: + branches: [main] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + ENV_STAGE: stage + +jobs: + build-and-push-to-ghcr: + name: Build + runs-on: ubuntu-20.04 + permissions: + contents: read + packages: write + outputs: + tag: ${{ steps.prep.outputs.tag }} + steps: + - uses: actions/checkout@v2 + + - id: prep + run: | + TAG=$(echo $GITHUB_SHA | head -c7) + IMAGE="${{ env.REGISTRY }}/edenartlab/hello" + echo ::set-output name=tagged_image::${IMAGE}:${TAG} + echo ::set-output name=tag::${TAG} + echo ::set-output name=image::${IMAGE} + + - name: Log in to GHCR + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and Push + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + push: true + tags: + ${{ steps.prep.outputs.tagged_image }},${{ steps.prep.outputs.image + }}:latest \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cc46c4a --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# See https://help.github.com/ignore-files/ for more about ignoring files. + +.env + + +# dependencies +/node_modules +package-lock.json + +# misc +.DS_Store +.env.production +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Next.js +/.next +tsconfig.tsbuildinfo diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..ea964c0 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,6 @@ +# Ignore artifacts: +dist +.next +build +node_modules/ +public \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..201d218 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,19 @@ +{ + "arrowParens": "avoid", + "bracketSpacing": true, + "printWidth": 80, + "proseWrap": "always", + "singleQuote": true, + "tabWidth": 2, + "semi": false, + "trailingComma": "all", + "overrides": [ + { + "files": "*.md", + "options": { + "printWidth": 600 + } + } + ], + "organizeImportsSkipDestructiveCodeActions": true +} diff --git a/.yarnrc b/.yarnrc new file mode 100644 index 0000000..18fe519 --- /dev/null +++ b/.yarnrc @@ -0,0 +1 @@ +--ignore-platform true \ No newline at end of file