Skip to content

Add publish automation workflows #1

Add publish automation workflows

Add publish automation workflows #1

Workflow file for this run

name: npm publish
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch name'
required: true
type: string
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check if branch exists
id: check-branch
run: |
if git ls-remote --heads origin ${{ github.event.inputs.branch }} | grep -q refs/heads/${{ github.event.inputs.branch }}; then
echo "Branch exists."
else
echo "Branch does not exist."
exit 1
fi
- uses: actions/setup-node@v3
- name: Install and Build 🔧
- run: |
npm install

Check failure on line 30 in .github/workflows/package-publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/package-publish.yml

Invalid workflow file

You have an error in your yaml syntax on line 30
npm version ${{ github.event.inputs.version }}
cp .env .env.production
echo "VITE_CHAT_AI_WIDGET_KEY=${{ secrets.chat_ai_widget_key }}" >> .env.production
npm run build:pages
- name: 'set environments'
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.npm_token }}" >> .npmrc
git config --global user.email "[email protected]"
git config --global user.name "sendbird-sdk-deployment"
- name: 'build and publish to npm'
run: |
npm publish -access=public
- name: 'create a pull request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create --title "chore(release): publish ${{ github.event.inputs.version }}" --body "created by automation"