chore: added the new npm deploy flow (#71) #57
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
name: Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
environment: | |
name: Release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- name: Load secret | |
uses: 1password/load-secrets-action@581a835fb51b8e7ec56b71cf2ffddd7e68bb25e0 | |
with: | |
# Export loaded secrets as environment variables | |
export-env: true | |
env: | |
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | |
NPM_TOKEN: op://npm-deploy/npm-token/secret | |
GITHUB_TOKEN: op://npm-deploy/GITHUB_TOKEN/token | |
- name: Install dependencies | |
run: yarn --frozen-lockfile | |
- name: Lint | |
run: yarn lint | |
if: success() | |
- name: Release | |
env: | |
NPM_CONFIG_USERCONFIG: /dev/null | |
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ env.NPM_TOKEN }} | |
run: yarn release | |
if: success() |