Skip to content

Commit

Permalink
Merge pull request #1 from grokku/alp-15-document-github-action-on-pa…
Browse files Browse the repository at this point in the history
…rallax-scroller-project

docs: ✏️ Document GitHub actions
  • Loading branch information
andrii-grokku committed Nov 28, 2023
2 parents 6a33702 + 8681c98 commit 15d30f7
Show file tree
Hide file tree
Showing 17 changed files with 528 additions and 167 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
dist
29 changes: 19 additions & 10 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
name: Lint

# Run this workflow on pushes to main
on: push

# A workflow run is made up of one or more sequential or parallel jobs
jobs:
# This workflow contains a single job called "eslint"
eslint:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps are a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout code
uses: actions/checkout@v4
# Check out repository under $GITHUB_WORKSPACE, so the job can access it
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
# Eslint runs on Node.js — we need to set this up first
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npm install
# Install dependencies, using cache
- name: Install
uses: bahmutov/npm-install@v1

- name: Run Linter
run: npm run lint
# Run eslint
- name: Run Linter
run: npm run lint
20 changes: 15 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,39 @@
name: Publish

# Run this workflow every time a new release is created
on:
push:
branches: [main]
release:
types: [released]

# A workflow run is made up of one or more sequential or parallel jobs
jobs:
# This workflow contains a single job called "publish"
publish:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps are a sequence of tasks that will be executed as part of the job
steps:
# Check out repository under $GITHUB_WORKSPACE, so the job can access it
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
# Analyzer runs on Node.js — we need to set this up first
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
node-version: 20
registry-url: "https://registry.npmjs.org"

- name: Clean install dependencies
# Clean install dependencies
- name: Install
run: npm ci

# Buld the project
- name: Build
run: npm run build

# Publish to NPM
- name: Publish to registry
run: npm publish
env:
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
name: Test

# Run this workflow Pull Request action to main
on:
pull_request:
branches:
- main

# A workflow run is made up of one or more sequential or parallel jobs
jobs:
# This workflow contains a single job called "test"
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps are a sequence of tasks that will be executed as part of the job
steps:
# Check out repository under $GITHUB_WORKSPACE, so the job can access it
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
# Tests run on Node.js — we need to set this up first
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: 20

- name: Install dependencies
run: npm install
# Install dependencies, using cache
- name: Install
uses: bahmutov/npm-install@v1

# Run tests
- name: Test
run: npm run test
2 changes: 1 addition & 1 deletion demo/parallax-scroller.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 15d30f7

Please sign in to comment.