Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
GarretTomlin committed Sep 13, 2023
1 parent 8802e49 commit 652cf0c
Showing 1 changed file with 59 additions and 47 deletions.
106 changes: 59 additions & 47 deletions .github/workflows/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,52 +22,64 @@ jobs:
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
test:
runs-on: ubuntu-latest
timeout-minutes: 0.33
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install Dependencies
run: bun install --frozen-lockfile
- name: Run Tests
run: bun tests
env:
DATABASE_URL: 'postgresql://postgres:postgres@localhost:5432/mydb'

packageChanges:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16.x
- run: bun install --frozen-lockfile
- name: Lint code
run: bun run lint
- name: Build code
run: bun run build

publishPackage:
needs: packageChanges
if: needs.packageChanges.result == 'success' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16.x
- run: bun install --frozen-lockfile
- name: Authenticate with NPM
run: echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> ~/.npmrc
- name: Create Release Pull Request or Publish
id: changesets
run: |
bun run release
env:
GITHUB_TOKEN: ${{ secrets.GGITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16

- name: Install dependencies
run: bun install

- name: Run tests
env:
DATABASE_URL: 'postgresql://postgres:postgres@localhost:5432/mydb'
run: bun test


packageChanges:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16.x
- name: Navigate to Package Directory
run: |
cd packages/
yarn install --frozen-lockfile
yarn run lint && yarn run build
publishPackage:
needs: packageChanges
if: needs.packageChanges.result == 'success' && github.ref == 'refs/heads/main'

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16.x
- name: Authenticate with NPM
run: echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> ~/.npmrc
- name: Create Release Pull Request or Publish
id: changesets

run: |
cd packages/
yarn install --frozen-lockfile
yarn run release
env:
GITHUB_TOKEN: ${{ secrets.GGITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 652cf0c

Please sign in to comment.