fix(deps): upgrade deps #32
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: Node build, test and publish | |
on: | |
pull_request: | |
types: [assigned, opened, synchronize, reopened] | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
prepare: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cleanup stale actions | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: yarn | |
- uses: getsentry/action-clickhouse-in-ci@v1 | |
- name: Run postgres | |
shell: bash | |
run: | | |
docker run \ | |
--name postgres \ | |
--health-cmd pg_isready \ | |
--health-interval 10s \ | |
--health-timeout 5s \ | |
--health-retries 5 \ | |
-e POSTGRES_PASSWORD=postgres \ | |
-e PGUSER=postgres \ | |
-p 5432:5432 \ | |
-d ghcr.io/sesamecare/postgres-postgis-plv8:main | |
- name: Wait for PostgreSQL to be ready | |
shell: bash | |
run: | | |
for i in {1..20}; do | |
if docker inspect --format "{{json .State.Health.Status }}" ${{ inputs.name || 'postgres' }} | grep '"healthy"'; then | |
echo "PostgreSQL is ready!" | |
exit 0 | |
fi | |
echo "Waiting for PostgreSQL to be ready..." | |
sleep 5 | |
done | |
echo "PostgreSQL did not become ready in time." | |
exit 1 | |
- name: Add docker container cleanup | |
uses: webiny/[email protected] | |
id: post-run-command | |
with: | |
run: | | |
docker rm -f postgres | |
- name: npm install, lint, build, and test | |
run: | | |
yarn install --immutable | |
make | |
yarn lint | |
yarn test | |
env: | |
CI: true | |
publish-npm: | |
needs: build | |
if: github.ref == 'refs/heads/main' | |
permissions: | |
contents: write | |
issues: write | |
id-token: write | |
pull-requests: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: yarn | |
- run: yarn install --immutable | |
- run: yarn build | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.SESAMECARE_OSS_NPM_TOKEN }} | |
run: | | |
yarn dlx semantic-release |