This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# When issue is created with title "Deploy" and anybody | |
# comment "/deploy" in comment this workflow is triggered. | |
# This workflow publish the package in @next tag. | |
name: Process master branch for @next tag | |
on: | |
issue_comment: | |
types: [created] | |
jobs: | |
prepare-master: | |
if: ${{ contains(github.event.comment.html_url, '/issues') && contains(github.event.comment.body, '/deploy') && (github.event.issue.state == 'open') && (github.event.issue.title == 'Deploy') }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- run: | | |
git config user.name bhoos-devops | |
git config user.email devops@bhoos.com | |
echo -e "github.com\n login $GITHUB_TOKEN" >> ~/.netrc | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '14.x' | |
registry-url: 'https://npm.pkg.github.com' | |
scope: '@bhoos' | |
- name: Install Dependencies and publish packages | |
run: | | |
yarn | |
yarn build | |
yarn lerna run build | |
yarn lerna publish from-package --yes --no-verify-access --dist-tag next | |
version=$(node -p "require('./lerna.json').version") | |
echo "RELEASE_VERSION=v${version}" >> $GITHUB_ENV | |
echo "ISSUE_NUMBER=${{github.event.issue.number}}" >> $GITHUB_ENV | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Release for moving to production | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ env.RELEASE_VERSION }} | |
name: Release ${{ env.RELEASE_VERSION }} (#${{ env.ISSUE_NUMBER }}) | |
commit: master | |
body: ${{steps.github_release.outputs.changelog}} | |
draft: true | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |