Skip to content

Commit

Permalink
Merge pull request #12 from PrestaShopCorp/feature/npm-publish
Browse files Browse the repository at this point in the history
CI/CD - publish workflow
  • Loading branch information
MaxencePerrinPrestashop authored Dec 18, 2020
2 parents 3aa6af3 + d25720e commit 4fbde84
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: publish

on:
push:
tags:
- '*'

jobs:
publish:
name: build
runs-on: ubuntu-latest
steps:
- name: Get tag
id: get_tag
run: echo ::set-output name=TAG::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Checkout project
uses: actions/checkout@v1

- name: Setup node version
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- name: Install
run: yarn

- name: Build
run: yarn run build

- name: Update npm version
run: npm version $VERSION --no-git-tag-version --allow-same-version
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
VERSION: ${{ steps.get_tag.outputs.TAG }}

- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 4fbde84

Please sign in to comment.