ethanneff/example

View on GitHub
.github/workflows/deploy-to-github-packages.yml

Summary

Maintainability
Test Coverage
name: Deploy Package

on:
  push:
    branches: [master]

jobs:
  deploy-to-github-packages:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
          persist-credentials: false

      - name: Setup node
        uses: actions/setup-node@v3
        with:
          node-version: 20
          cache: 'yarn'

      - name: Install node dependencies
        run: yarn ci-install

      - name: Update version
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: yarn ci-release

      - name: Setup github
        uses: actions/setup-node@v3
        with:
          node-version: 20
          cache: 'yarn'
          registry-url: https://npm.pkg.github.com/
          scope: '@ethanneff'

      - name: Deploy to github packages
        run: npm publish
        env:
          NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}