v4.4.3 release (MikeoftheClan) > CI/CD Workflow #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD Workflow | |
run-name: ${{ github.ref_name }} release (${{ github.actor }}) > CI/CD Workflow | |
on: | |
release: | |
types: [created] | |
jobs: | |
npm_install_test: | |
name: Npm - Install & Test | |
runs-on: ubuntu-latest | |
services: | |
elasticsearch: | |
image: elasticsearch:8.8.0 | |
ports: | |
- 9200:9200 | |
env: | |
ES_JAVA_OPTS: -Xms512m -Xmx512m | |
discovery.type: single-node | |
xpack.security.enabled: false | |
volumes: | |
- elasticsearchdata:/usr/share/elasticsearch/data | |
- elasticsearchconfig:/usr/share/elasticsearch/config | |
- elasticsearchlogs:/usr/share/elasticsearch/logs | |
redis: | |
image: redis:6.2.11 | |
ports: | |
- 6379:6379 | |
mongo: | |
image: mongo:4.0.28 | |
ports: | |
- 27017:27017 | |
steps: | |
- name: Checking out repository | |
uses: actions/checkout@v3 | |
- name: Setting up Node | |
uses: actions/setup-node@v3 | |
with: | |
cache: npm | |
cache-dependency-path: package-lock.json | |
node-version: 18.13.0 | |
- name: Installing dependencies | |
run: npm ci | |
- name: Testing package | |
run: npm test | |
npm_publish: | |
name: Npm - Publish | |
needs: npm_install_test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out repository | |
uses: actions/checkout@v3 | |
- name: Setting up Node + package registry login config | |
uses: actions/setup-node@v3 # also creates a .npmrc file with registry login config inside the runner, which will use a npm automation token set in $NODE_AUTH_TOKEN env | |
with: | |
always-auth: true | |
cache: npm | |
cache-dependency-path: package-lock.json | |
node-version: 18.13.0 | |
registry-url: https://registry.npmjs.org | |
- name: Package registry login + publish | |
run: npm publish # will also login before publishing, using the config in .npmrc | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |