Skip to content

Commit

Permalink
ci: setup
Browse files Browse the repository at this point in the history
1. use npm
2. use ./dist
3. add setup-node & cache-node-modules GH actions
4. update README.md
5. tidy up .gitignore
  • Loading branch information
Beraliv committed Dec 8, 2024
1 parent efa9b20 commit b2c14b3
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 14 deletions.
18 changes: 18 additions & 0 deletions .github/actions/cache-node-modules/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Cache node modules
description: Caches dependencies by lock file

runs:
using: composite
steps:
- name: Cache files
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
10 changes: 10 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Setup node
description: Configures node

runs:
using: composite
steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
9 changes: 3 additions & 6 deletions .github/workflows/deploy-ts-conversion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ jobs:
- name: Caches node modules
uses: ./.github/actions/cache-node-modules

- name: Setup pnpm
uses: ./.github/actions/setup-pnpm

- name: Install dependencies
run: pnpm install
run: npm install

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand All @@ -33,7 +30,7 @@ jobs:
aws-region: eu-central-1

- name: Build
run: pnpm --filter ts-conversion run build
run: npm run build

- name: Deploy to AWS S3
run: aws s3 sync ./packages/ts-conversion/dist s3://ts-conversion.beraliv.com --delete
run: aws s3 sync ./dist s3://ts-conversion.beraliv.com --delete
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ Try it now: https://ts-conversion.beraliv.com

## Quick start

This project is part of pnpm workspaces.

To install all dependencies, run the install command:

```bash
pnpm install
npm install
```

To start developing the project, run the dev command:

```bash
pnpm --filter ts-conversion run dev --host
npm run dev --host
```

0 comments on commit b2c14b3

Please sign in to comment.