Skip to content

Commit 5f3b1de

Browse files
Update issue1143.yml
1 parent ab4be93 commit 5f3b1de

File tree

1 file changed

+46
-25
lines changed

1 file changed

+46
-25
lines changed

.github/workflows/issue1143.yml

+46-25
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,54 @@
11
name: Release (Private Packages)
22
on:
3+
push:
4+
branches:
5+
- master
6+
paths:
7+
- ".changeset/**"
8+
- ".github/workflows/packages-release.yml"
39
workflow_dispatch:
10+
env:
11+
CI: true
12+
PNPM_CACHE_FOLDER: .pnpm-store
413
jobs:
514
version_or_release:
615
name: 'Version and open PR (or) release private packages'
16+
timeout-minutes: 15
717
runs-on: ubuntu-latest
18+
environment: 'Production - Private Packages'
819
steps:
9-
- name: Checkout code
10-
uses: actions/checkout@v4
11-
with:
12-
ref: dev
13-
14-
- name: Set up SSH
15-
uses: webfactory/[email protected]
16-
with:
17-
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY_RUNNER }}
18-
19-
- name: Add SSH known hosts
20-
run: |
21-
mkdir -p ~/.ssh
22-
ssh-keyscan -p ${{ secrets.SSH_PORT }} ${{ secrets.HOST_DEV }} >> ~/.ssh/known_hosts
23-
24-
- name: Deploy to server
25-
run: |
26-
ssh -p ${{ secrets.SSH_PORT }} ${{ secrets.HOST_USER }}@${{ secrets.HOST_DEV }} << 'EOF'
27-
cd /home/app
28-
git checkout dev
29-
git pull origin dev
30-
yarn
31-
yarn db:migrate
32-
pm2 restart crm_backend
33-
EOF
20+
- name: checkout code repository
21+
uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0
24+
- uses: pnpm/action-setup@v4
25+
- name: setup node.js
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: 18
29+
cache: 'pnpm'
30+
- name: setup pnpm store config
31+
run: pnpm config set store-dir $PNPM_CACHE_FOLDER
32+
- name: install dependencies
33+
run: pnpm install --frozen-lockfile
34+
- name: setup npmrc file to configure pnpm
35+
run: |
36+
cat << EOF > "$HOME/.npmrc"
37+
@mycompany:registry=https://npm.pkg.github.com
38+
//npm.pkg.github.com/:_authToken=$NPM_PUBLISH_TOKEN
39+
//registry.npmjs.org/:_authToken=null
40+
EOF
41+
env:
42+
NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
43+
HOME: ${{ github.workspace }}
44+
- name: create and publish versions
45+
uses: changesets/action@v1
46+
with:
47+
cwd: ${{ github.workspace }}
48+
version: pnpm run version
49+
commit: "chore: update package versions"
50+
title: "Release (Private Packages)"
51+
publish: pnpm run publish:ci
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
HOME: ${{ github.workspace }}

0 commit comments

Comments
 (0)