Skip to content

Commit

Permalink
fix(ci): ref #7
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridermansb committed Jul 17, 2020
1 parent cfe9bd3 commit bfea1c8
Showing 1 changed file with 22 additions and 39 deletions.
61 changes: 22 additions & 39 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,34 @@ on:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm ci
- run: npm run build

release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
fetch-depth: 0
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- uses: actions/setup-node@v2
with:
node-version: 12

- name: Get npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"
- name: Cache .npm directory
id: cache-node_modules
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-

- name: Install app dependencies
if: steps.cache-node_modules.outputs.cache-hit != 'true'
run: npm ci --prefer-offline --no-audit --progress=false

- run: npm run build

- uses: chrnorm/deployment-action@releases/v1
name: Create GitHub deployment
id: deployment
Expand All @@ -36,6 +46,7 @@ jobs:
- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
run: npm run release

- name: Update deployment status (success)
Expand All @@ -53,31 +64,3 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
state: "failure"
deployment_id: ${{ steps.deployment.outputs.deployment_id }}

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run release
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}

publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm run release
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_AUTH_TOKEN}}

0 comments on commit bfea1c8

Please sign in to comment.