Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: convert to cloudflare workers template #2

Merged
merged 6 commits into from Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 0 additions & 12 deletions .dockerignore

This file was deleted.

14 changes: 14 additions & 0 deletions .editorconfig
@@ -0,0 +1,14 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
max_line_length = 120
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
max_line_length = 0
trim_trailing_whitespace = false
9 changes: 0 additions & 9 deletions .env.example

This file was deleted.

49 changes: 49 additions & 0 deletions .eslintrc.cjs
@@ -0,0 +1,49 @@
module.exports = {
plugins: [
"jest"
],
extends: [
"airbnb-base/legacy",
"airbnb-base/whitespace",
],
env: {
browser: true,
serviceworker: true,
es2021: true,
"jest/globals": true
},
globals: {
// secrets
APP_ID: "readonly",
APP_PK: "readonly",
CLIENT_ID: "readonly",
CLIENT_SECRET: "readonly",
WEBHOOK_SECRET: "readonly",
DISCORD_URL: "readonly",
},
parserOptions: {
ecmaVersion: 13,
ecmaFeatures: {
impliedStrict: true
},
sourceType: "module",
allowImportExportEverywhere: false
},
ignorePatterns: [
'dist/',
'node_modules/',
'worker/',
],
rules: {
"no-console": 0,
"import/no-unresolved": 0,
"import/extensions": 0,
"no-restricted-syntax": 0,
"no-restricted-globals": 0,
camelcase: [2, {
allow: [
"avatar_url"
],
}]
}
};
13 changes: 13 additions & 0 deletions .github/workflows/codeql-analysis.yml
@@ -0,0 +1,13 @@
name: "CodeQL"

on:
push:
branches:
- main
pull_request:
schedule:
- cron: '56 5 * * 1'

jobs:
analyze:
uses: open-sauced/open-sauced/.github/workflows/codeql-analysis.yml@main
15 changes: 15 additions & 0 deletions .github/workflows/compliance.yml
@@ -0,0 +1,15 @@
name: "Compliance"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: write

jobs:
compliance:
uses: open-sauced/open-sauced/.github/workflows/compliance.yml@main
13 changes: 13 additions & 0 deletions .github/workflows/development.yml
@@ -0,0 +1,13 @@
name: "Development"

on:
pull_request:
types:
- opened
- edited
- synchronize
- reopened

jobs:
test:
uses: open-sauced/open-sauced/.github/workflows/development.yml@main
93 changes: 93 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,93 @@
name: Release

on:
push:
branches:
- main
- alpha
- beta
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to npx wrangler after a successful release?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried that in 5f3b486 but it leaks deployment URL :/ can put it back and test it out for a while


concurrency:
group: environment-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test and lint
uses: open-sauced/open-sauced/.github/workflows/development.yml@main

build:
name: Build application
runs-on: ubuntu-latest
steps:
- name: "☁️ checkout repository"
uses: actions/checkout@v2

- name: "πŸ”§ setup node"
uses: actions/setup-node@v2.1.5
with:
node-version: 16

- name: "πŸ”§ install npm@latest"
run: npm i -g npm@latest

- name: "πŸ“¦ install dependencies"
uses: bahmutov/npm-install@v1

- name: "πŸ“Š repository visualizer"
id: diagram
uses: githubocto/repo-visualizer@0.7.1
with:
excluded_paths: "node_modules,build,.storybook,.netlify,.github,npm-shrinkwrap.json"
output_file: "public/diagram.svg"
should_push: false
root_path: "src/"

- name: "πŸ“Š visualiser artifacts"
uses: actions/upload-artifact@v2
with:
name: diagram
path: public/diagram.svg

release:
environment:
name: production
url: https://github.com/${{ github.repository }}/releases/tag/${{ steps.semantic-release.outputs.release-tag }}
name: Semantic release
needs:
- test
- build
runs-on: ubuntu-latest
steps:
- name: "☁️ checkout repository"
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: "♻️ clean up artifact paths"
run: |
rm -rf public/diagram.svg

- name: "πŸ“‚ download diagram artifacts"
uses: actions/download-artifact@v2
with:
name: diagram
path: public/

- name: "πŸš€ release"
id: semantic-release
uses: open-sauced/release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

cleanup:
name: Cleanup actions
needs:
- release
runs-on: ubuntu-latest
steps:
- name: "♻️ remove build artifacts"
uses: geekyeggo/delete-artifact@v1
with:
name: |
diagram
11 changes: 11 additions & 0 deletions .github/workflows/triage.yml
@@ -0,0 +1,11 @@
name: "Assign issues"

on:
issue_comment:
types:
- created
- edited

jobs:
assign:
uses: open-sauced/open-sauced/.github/workflows/triage.yml@main