Skip to content

Commit

Permalink
update readme and action to publish
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieCurnow committed Oct 30, 2023
1 parent 64b81ac commit b95078f
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-on-pr.yml
@@ -0,0 +1,41 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Pack / build on PR to main
on: pull_request
jobs:
Bluid:
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [18]

steps:
- name: Checkout 🛎
uses: actions/checkout@master

- name: Cache node modules
uses: actions/cache@v3
id: cache-nodemodules
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in on Linux/macOS
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install project dependencies 👨🏻‍💻
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: npm ci
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Build and pack
run: npm run dev:prepare && npm run lint && npm run test && npm run prepack
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,59 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Release to NPM

on:
push:
branches:
- 'main'

jobs:
ci:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [18]

steps:
- name: Checkout 🛎
uses: actions/checkout@master

- name: Setup git
uses: oleksiyrudenko/gha-git-credentials@v2-latest
with:
token: '${{ secrets.GITHUB_TOKEN }}'
name: 'JamieCurnow'
email: 'jamie@island-web.ca'
actor: 'jamiecurnow'

# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'

- name: Cache node modules
uses: actions/cache@v3
id: cache-nodemodules
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in on Linux/macOS
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install project dependencies 👨🏻‍💻
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: npm ci

- name: Build and release
run: npm run release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions README.md
@@ -1,5 +1,7 @@
# Doppler Nuxt Module

## Made with 💚 by [Hiyield](https://hiyield.co.uk/)

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]
Expand Down

0 comments on commit b95078f

Please sign in to comment.