Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
chore: abstract workflow
  • Loading branch information
Vilsol committed Jun 15, 2022
1 parent 4e811be commit a48108a
Show file tree
Hide file tree
Showing 9 changed files with 1,020 additions and 862 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Production

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
uses: ./.github/workflows/push-base.yml
with:
env: production
60 changes: 36 additions & 24 deletions .github/workflows/push.yml → .github/workflows/push-base.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: push
name: Base

on: [ push, pull_request ]
on:
workflow_call:
inputs:
env:
required: true
type: string

env:
NODE_VERSION: "16"
PNPM_VERSION: "6.32.9"

jobs:
build:
Expand All @@ -11,14 +20,13 @@ jobs:
matrix:
action: [ "build:node", "build:static" ]
steps:

- name: Checkout
uses: actions/checkout@v2

- name: Setup nodejs
uses: actions/setup-node@v1
with:
node-version: 16
node-version: ${{ env.NODE_VERSION }}

- name: Cache pnpm modules
uses: actions/cache@v2
Expand All @@ -31,26 +39,29 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-16-
- name: Install dependencies
uses: pnpm/action-setup@v1.2.1
uses: pnpm/action-setup@v2.2.2
with:
version: 5.17.2
version: ${{ env.PNPM_VERSION }}
run_install: true

- name: Build
run: pnpm graphql-codegen:prod && pnpm ${{ matrix.action }}
run: |
set -o allexport; source .env.${{ inputs.env }}; set +o allexport
pnpm graphql-codegen && pnpm ${{ matrix.action }}
env:
NODE_ENV: ${{ inputs.env }}

lint:
name: Lint
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v2

- name: Setup nodejs
uses: actions/setup-node@v1
with:
node-version: 16
node-version: ${{ env.NODE_VERSION }}

- name: Cache pnpm modules
uses: actions/cache@v2
Expand All @@ -63,13 +74,17 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-16-
- name: Install dependencies
uses: pnpm/action-setup@v1.2.1
uses: pnpm/action-setup@v2.2.2
with:
version: 5.17.2
version: ${{ env.PNPM_VERSION }}
run_install: true

- name: Lint
run: pnpm graphql-codegen:prod && pnpm check && pnpm lint
run: |
set -o allexport; source .env.${{ inputs.env }}; set +o allexport
pnpm graphql-codegen && pnpm check && pnpm lint
env:
NODE_ENV: ${{ inputs.env }}

pages:
name: Pages
Expand All @@ -79,14 +94,13 @@ jobs:
- lint
if: ${{ github.event_name != 'pull_request' }}
steps:

- name: Checkout
uses: actions/checkout@v2

- name: Setup nodejs
uses: actions/setup-node@v1
with:
node-version: 16
node-version: ${{ env.NODE_VERSION }}

- name: Cache pnpm modules
uses: actions/cache@v2
Expand All @@ -99,18 +113,21 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-16-
- name: Install dependencies
uses: pnpm/action-setup@v1.2.1
uses: pnpm/action-setup@v2.2.2
with:
version: 5.17.2
version: ${{ env.PNPM_VERSION }}
run_install: true

- name: Inject slug/short variables
uses: rlespinasse/[email protected]

- name: Build
run: pnpm graphql-codegen:prod && pnpm build:static
run: |
set -o allexport; source .env.${{ inputs.env }}; set +o allexport
pnpm graphql-codegen && pnpm build:static
env:
SVELTE_BASE_PATH: "/${{ env.GITHUB_REPOSITORY_NAME_PART_SLUG }}/${{ env.GITHUB_REF_SLUG }}"
NODE_ENV: ${{ inputs.env }}

- name: Deploy to pages
uses: JamesIves/[email protected]
Expand All @@ -122,15 +139,10 @@ jobs:
image:
name: Image
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [ "staging", "production" ]
needs:
- build
- lint
steps:

- name: Checkout
uses: actions/checkout@v2

Expand All @@ -148,7 +160,7 @@ jobs:
images: ghcr.io/${{ github.repository }}
flavor: |
latest=false
suffix=-${{ matrix.target }}
suffix=-${{ inputs.env }}
- name: Build and push
uses: docker/build-push-action@v2
Expand All @@ -158,4 +170,4 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD=build:${{ matrix.target }}
BUILD=build:${{ inputs.env }}
15 changes: 15 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Staging

on:
push:
branches-ignore:
- main
pull_request:
branches-ignore:
- main

jobs:
build:
uses: ./.github/workflows/push-base.yml
with:
env: staging
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,5 @@ $RECYCLE.BIN/
/schema.graphql
/graphql.schema.json
/.svelte-kit
/static/smui.css
/static/smui.css
/.pnpm-store
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ schema.graphql
svelte.config.js
tailwind.config.cjs
tsconfig.json
.pnpm-store
2 changes: 1 addition & 1 deletion codegen.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
overwrite: true
schema: "https://api.ficsit.app/v2/query"
schema: ${SCHEMA_PATH:https://api.ficsit.app/v2/query}
documents: "src/**/*.graphql"
generates:
./src/lib/generated/graphql.ts:
Expand Down
49 changes: 25 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"build:static": "rimraf .svelte build/static && svelte-kit build",
"check": "svelte-check --ignore build,.svelte,.svelte-kit",
"check:dev": "pnpm run check -- --watch",
"dev": "run-p -r graphql-codegen:prod:watch dev:serve check:dev lint:dev",
"dev": "run-p -r graphql-codegen:watch dev:serve check:dev lint:dev",
"dev:serve": "svelte-kit dev",
"graphql-codegen:prod": "graphql-codegen --config codegen.yml",
"graphql-codegen:prod:watch": "graphql-codegen --config codegen.yml --watch",
"graphql-codegen": "graphql-codegen --config codegen.yml",
"graphql-codegen:watch": "graphql-codegen --config codegen.yml --watch",
"lint": "eslint . --ext .ts,.svelte && prettier --check --plugin-search-dir=. .",
"lint:dev": "chokidar -c \"eslint . --ext .ts,.svelte --cache\" --silent --initial \"src/**/*.svelte\" \"src/**/*.ts\"",
"prepare": "husky install && run-s smui-theme",
Expand Down Expand Up @@ -59,7 +59,7 @@
"@material/top-app-bar": "^13.0.0",
"@material/touch-target": "^13.0.0",
"@material/typography": "^13.0.0",
"@urql/core": "^2.3.6",
"@urql/core": "^2.4.1",
"@urql/exchange-auth": "^0.1.7",
"@urql/exchange-graphcache": "^4.3.6",
"@urql/exchange-multipart-fetch": "^0.1.14",
Expand All @@ -68,11 +68,11 @@
"@urql/svelte": "^1.3.3",
"custom-protocol-check": "^1.3.0",
"felte": "^0.9.0",
"graphql": "^16.2.0",
"graphql": "^16.3.0",
"js-cookie": "^3.0.1",
"jsdom": "^19.0.0",
"jszip": "^3.7.1",
"marked": "^4.0.10",
"marked": "^4.0.12",
"prismjs": "^1.26.0",
"semver": "^7.3.5",
"socket.io-client": "^4.4.1",
Expand All @@ -81,7 +81,7 @@
"zod": "^3.11.6"
},
"devDependencies": {
"@cfworker/json-schema": "^1.12.0",
"@cfworker/json-schema": "^1.12.1",
"@commitlint/cli": "^16.1.0",
"@commitlint/config-conventional": "^16.0.0",
"@graphql-codegen/add": "^3.1.1",
Expand All @@ -91,8 +91,8 @@
"@graphql-codegen/typescript": "2.4.2",
"@graphql-codegen/typescript-document-nodes": "2.2.2",
"@graphql-codegen/typescript-graphql-files-modules": "2.1.1",
"@graphql-codegen/typescript-operations": "2.2.2",
"@graphql-codegen/typescript-urql": "^3.4.2",
"@graphql-codegen/typescript-operations": "2.2.3",
"@graphql-codegen/typescript-urql": "^3.5.0",
"@graphql-codegen/urql-introspection": "2.1.1",
"@graphql-typed-document-node/core": "^3.1.1",
"@smui/button": "^6.0.0-beta.13",
Expand All @@ -118,44 +118,45 @@
"@smui/switch": "^6.0.0-beta.13",
"@smui/textfield": "^6.0.0-beta.13",
"@smui/top-app-bar": "^6.0.0-beta.13",
"@sveltejs/adapter-node": "^1.0.0-next.66",
"@sveltejs/adapter-node": "^1.0.0-next.67",
"@sveltejs/adapter-static": "^1.0.0-next.26",
"@sveltejs/kit": "^1.0.0-next.240",
"@sveltejs/kit": "^1.0.0-next.255",
"@types/js-cookie": "^3.0.1",
"@types/marked": "^4.0.1",
"@types/node": "^17.0.10",
"@types/prismjs": "^1.16.6",
"@types/marked": "^4.0.2",
"@types/node": "^17.0.14",
"@types/prismjs": "^1.26.0",
"@types/semver": "^7.3.9",
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.10.0",
"@typescript-eslint/eslint-plugin": "^5.10.2",
"@typescript-eslint/parser": "^5.10.2",
"autoprefixer": "^10.4.2",
"chokidar-cli": "^3.0.0",
"cookieconsent": "^3.1.1",
"cross-env": "^7.0.3",
"cssnano": "^5.0.15",
"cssnano": "^5.0.16",
"cz-conventional-changelog": "^3.3.0",
"dompurify": "^2.3.4",
"eslint": "^8.7.0",
"dompurify": "^2.3.5",
"eslint": "^8.8.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-svelte3": "^3.4.0",
"graphql-tag": "^2.12.6",
"husky": "^7.0.4",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.5",
"postcss": "^8.4.6",
"postcss-import-url": "^7.0.0",
"postcss-load-config": "^3.1.1",
"postcss-preset-env": "^7.2.3",
"postcss-preset-env": "^7.3.0",
"prettier": "~2.5.1",
"prettier-plugin-svelte": "^2.6.0",
"rimraf": "^3.0.2",
"rollup-plugin-terser": "^7.0.2",
"schema-dts": "^1.0.0",
"smui-theme": "^6.0.0-beta.13",
"svelte": "^3.46.2",
"svelte-check": "^2.3.0",
"svelte": "^3.46.3",
"svelte-check": "^2.4.1",
"svelte-preprocess": "^4.10.2",
"tailwindcss": "^3.0.15",
"typescript": "^4.5.5",
"urql": "^2.0.6",
"urql": "^2.1.2",
"vite": "^2.7.13"
},
"type": "module",
Expand Down
Loading

0 comments on commit a48108a

Please sign in to comment.