Skip to content

Commit

Permalink
Adding pipeline to deploy lib
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielrizzo committed Sep 14, 2021
1 parent 7907340 commit bd8d482
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: deploy

on:
release:
types: [ created ]

jobs:
deploy:
if: ${{ contains(github.ref, 'refs/tags/release-') }}
runs-on: ubuntu-latest
steps:
# GET TAG VERSION & RELEASE_VERSION IN $GITHUB_ENV
- name: Get TAG_VERSION & RELEASE_VERSION
run: |
echo "TAG_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/release-}" >> $GITHUB_ENV
# CHECKOUT REPOSITORY
- name: Checkout Repository
uses: actions/checkout@v2
with:
ref: main
# SETUP NODE ENV W/ NPM PUBLIC REGISTRY
- name: Setup Node Env
uses: actions/setup-node@v2
with:
registry-url: 'https://registry.npmjs.org'
# CONFIGURE GIT
- name: Configure Git
run: |
git config user.name github-ci
git config user.email [email protected]
# RUN SCRIPTS
- name: Update package version
run: node -e "let pkg=require('./package.json'); pkg.version='${{ env.RELEASE_VERSION }}'; require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, 2));"
- name: Build Package
run: |
npm install
npm run build
# PUBLISH VUE PACKAGE
- name: Publish VueJS Package
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# ADD & COMMIT CHANGES
- name: Add & Commit Changes
run: |
git add .
git commit -am "[github-ci] Published Version"
git push origin main:npm --force
# TAG VERSION
- name: Tag Version
run: |
git tag -a ${{ env.TAG_VERSION }} -m ${{ env.TAG_VERSION }} --force
git push --tags --force
# SUCCESS MESSAGE TO DISCORD
- name: Success Message to Discord
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.WEBHOOK_URL }}
title: "Published @yoonit/recorder v${{ env.RELEASE_VERSION }}"
description: |
A new release has been published:
[Click here to go to the release page](https://github.com/Yoonit-Labs/rxjs-yoonit-store/releases/tag/${{ env.TAG_VERSION }})
color: 0x00ff00
username: GitHub Actions

0 comments on commit bd8d482

Please sign in to comment.