Fixes Publishing Pipeline for GitHub

This commit is contained in:
James Ives 2020-05-16 18:11:24 -04:00
parent 44b3ce1d39
commit 8945e5d754
3 changed files with 19 additions and 10 deletions

View File

@ -2,6 +2,7 @@ name: publish-to-npm
on: on:
release: release:
types: [created] types: [created]
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -11,21 +12,24 @@ jobs:
ref: dev ref: dev
# Setup .npmrc file to publish to npm # Setup .npmrc file to publish to npm
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1.4.2
with: with:
node-version: 12 node-version: '10.15.1'
registry-url: 'https://registry.npmjs.org' registry-url: 'https://registry.npmjs.org'
scope: '@jamesives'
- name: Configure git - name: Configure git
run: | run: |
git config user.email "iam@jamesiv.es" git config user.email "iam@jamesiv.es"
git config user.name "James Ives" git config user.name "James Ives"
- run: npm install - name: Install Yarn
- run: npm run-script build run: npm install -g yarn
- run: yarn install --frozen-lockfile
- run: yarn build
- run: npm version patch -m "Release %s 📣" - run: npm version patch -m "Release %s 📣"
- run: git push - run: git push
- run: npm ci
# Publish to npm # Publish to npm
- run: npm publish --access public - run: npm publish --access public
@ -33,11 +37,16 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# Setup .npmrc file to publish to GitHub Packages # Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1.4.2
with: with:
node-version: 12 node-version: 12
registry-url: 'https://npm.pkg.github.com' registry-url: 'https://npm.pkg.github.com'
scope: '@JamesIves' scope: '@jamesives'
- name: Authenticate with the GitHub Package Registry
run:
echo "//npm.pkg.github.com:_authToken=${{ secrets.GITHUB_TOKEN }}" >
~/.npmrc
# Publish to GitHub Packages # Publish to GitHub Packages
- run: npm publish - run: npm publish

View File

@ -1,6 +1,6 @@
<p align="center"> <p align="center">
<a href="https://github.com/marketplace/actions/deploy-to-github-pages"> <a href="https://github.com/marketplace/actions/deploy-to-github-pages">
<img width="150px" src="./assets/icon.png"> <img width="150px" src="https://github.com/JamesIves/github-pages-deploy-action/raw/dev/assets/icon.png">
</a> </a>
</p> </p>
@ -35,7 +35,7 @@
</p> </p>
<p align="center"> <p align="center">
<img src="./assets/screenshot.png"> <img src="https://github.com/JamesIves/github-pages-deploy-action/raw/dev/assets/screenshot.png">
</p> </p>
## Getting Started :airplane: ## Getting Started :airplane:

View File

@ -1,5 +1,5 @@
{ {
"name": "github-pages-deploy-action", "name": "@jamesives/github-pages-deploy-action",
"description": "GitHub action for building a project and deploying it to GitHub pages.", "description": "GitHub action for building a project and deploying it to GitHub pages.",
"author": "James Ives <iam@jamesiv.es> (https://jamesiv.es)", "author": "James Ives <iam@jamesiv.es> (https://jamesiv.es)",
"version": "3.5.1", "version": "3.5.1",