Skip to content

Commit

Permalink
chore: new CI
Browse files Browse the repository at this point in the history
  • Loading branch information
RomRider committed Apr 2, 2023
1 parent 0e86dec commit 215ee60
Show file tree
Hide file tree
Showing 9 changed files with 16,931 additions and 6,782 deletions.
3 changes: 0 additions & 3 deletions .devcontainer/Dockerfile

This file was deleted.

5 changes: 3 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
{
"name": "Decluttering Card Development",
"dockerFile": "Dockerfile",
"image": "ghcr.io/ludeeus/devcontainer/generic:stable",
"context": "..",
"remoteUser": "vscode",
"appPort": [
"5000:5000",
"9123:8123"
Expand Down Expand Up @@ -33,4 +34,4 @@
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true
}
}
}
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
open-pull-requests-limit: 0
target-branch: 'dev'
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
target-branch: 'dev'
58 changes: 47 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,56 @@
name: "Build"
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master
- '*'
push:
branches:
- '*'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16.x
uses: actions/setup-node@v3.6.0
with:
node-version: 16.x
- name: Cache Node.js modules
uses: actions/cache@v3.3.1
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.OS }}-node-16.x-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-16.x
${{ runner.OS }}-
- name: Install dependencies
run: npm ci
- name: Lint the code
run: npm run lint --if-present
build:
name: Test build
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v1
- name: Build
run: |
npm install
npm run build
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.6.0
with:
node-version: ${{ matrix.node-version }}
- name: Cache Node.js modules
uses: actions/cache@v3.3.1
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.OS }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-${{ matrix.node-version }}
${{ runner.OS }}-
- name: Install dependencies
run: npm ci
- name: Build the project
run: npm run build --if-present
47 changes: 25 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
name: Release

on:
release:
types: [published]
on: workflow_dispatch

jobs:
release:
name: Prepare release
release-bundle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

# Build
- name: Build the file
run: |
cd /home/runner/work/decluttering-card/decluttering-card
npm install
npm run build
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'

# Upload build file to the releas as an asset.
- name: Upload zip to release
uses: svenstaro/upload-release-action@v1-release
outputs:
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
new_release_version: ${{ steps.semantic.outputs.new_release_version }}

steps:
- uses: actions/checkout@v3
- name: Use Node.js 16.x
uses: actions/setup-node@v3.6.0
with:
node-version: 16.x
- name: Cache Node.js modules
uses: actions/cache@v3.3.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /home/runner/work/decluttering-card/decluttering-card/dist/decluttering-card.js
asset_name: decluttering-card.js
tag: ${{ github.ref }}
overwrite: true
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.OS }}-node-16.x-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-16.x
${{ runner.OS }}-
- name: Install dependencies
run: npm ci
- name: Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 2 additions & 26 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,14 @@
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [{
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Chrome Localhost",
"url": "http://localhost:8123",
"webRoot": "${workspaceFolder}/dist",
"sourceMaps": true
},
{
"type": "browser-preview",
"request": "attach",
"name": "Browser Preview: Attach",
"webRoot": "${workspaceFolder}/dist",
"pathMapping": {
"http://127.0.0.1:5000/": "${workspaceFolder}/dist"
},
// "sourceMapPathOverrides": {
// "http://127.0.0.1:5000": "${workspaceFolder}/dist"
// },
}, {
"type": "browser-preview",
"request": "launch",
"name": "Browser Preview: Launch",
"url": "http://localhost:9123",
"webRoot": "${workspaceFolder}/dist",
// "sourceMapPathOverrides": {
// "http://127.0.0.1:5000": "${workspaceFolder}/dist"
// },
// "pathMapping": {
// "http://127.0.0.1:5000": "${workspaceFolder}/dist"
// },
// "trace": true
}
]
}

0 comments on commit 215ee60

Please sign in to comment.