-
Notifications
You must be signed in to change notification settings - Fork 72
73 lines (60 loc) · 2.26 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Publish
on:
push:
branches:
- 'main'
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
publish-npm:
runs-on: ubuntu-latest
outputs:
published: ${{ steps.changesets.outputs.published }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20.x
cache: 'yarn'
- name: Setup .yarnrc.yml
run: |
yarn config set npmAuthToken $NPM_TOKEN
yarn config set npmAlwaysAuth true
env:
NPM_TOKEN: ${{ secrets.CI_NPM_TOKEN }}
- name: Install
run: yarn install --immutable
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
version: yarn run version
publish: yarn run release:packages
env:
NPM_TOKEN: ${{ secrets.CI_NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
publish-docker:
needs: publish-npm
runs-on: ubuntu-latest
# TODO: only run if publish was made to @triplit/server
if: needs.publish-npm.outputs.published == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Install Node server dependencies
run: cd packages/node-server && yarn workspaces focus
- name: Build and push Node server Docker image
run: cd packages/node-server && PROJECTS_ADMIN_API_URL=${{secrets.PROJECTS_ADMIN_API_URL}} PROJECTS_ADMIN_API_KEY=${{secrets.PROJECTS_ADMIN_API_KEY}} yarn check-and-publish
- name: Install Bun server dependencies
run: cd packages/bun-server && yarn workspaces focus
- name: Build and push Bun server Docker image
run: cd packages/bun-server && PROJECTS_ADMIN_API_URL=${{secrets.PROJECTS_ADMIN_API_URL}} PROJECTS_ADMIN_API_KEY=${{secrets.PROJECTS_ADMIN_API_KEY}} yarn check-and-publish