-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (58 loc) · 1.86 KB
/
publish.yaml
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
# These workflows are copied from stardust-npm-scripts. Edit them there.
---
name: Lint, test, build, and publish
on:
release:
types:
- published
env:
GCLOUD_PROJECT_NAME: um-cloud-production
GCLOUD_PROJECT_ID: 72990522503
permissions:
# Needed to clone the repo
contents: read
# Needed for Workload Identity
id-token: write
# Needed to pull docker images
packages: write
jobs:
publish:
name: Publish regular version
if: "!contains(github.ref, 'beta')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: google-github-actions/auth@v0
with:
workload_identity_provider: projects/${{ env.GCLOUD_PROJECT_ID }}/locations/global/workloadIdentityPools/github/providers/github-actions
service_account: github-actions@${{ env.GCLOUD_PROJECT_NAME }}.iam.gserviceaccount.com
- name: Get common secrets
id: secrets
uses: google-github-actions/get-secretmanager-secrets@v0
with:
secrets: |-
slack:${{ env.GCLOUD_PROJECT_NAME }}/slack
github:${{ env.GCLOUD_PROJECT_NAME }}/github
- name: NPM cache
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ hashFiles('**/package-lock.json') }}
- uses: actions/setup-node@v2
with:
node-version: 16
- run: npm ci
env:
GITHUB_TOKEN: ${{ fromJson(steps.secrets.outputs.github).token }} # Needed because we install private packages from npm.pkg.github.com
- run: npm publish --tag beta
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: Stardust - Deploy
fields: repo,commit,message,author
env:
SLACK_WEBHOOK_URL: ${{ fromJson(steps.secrets.outputs.slack).webhook }}
SLACK_USERNAME: Stardust
if: failure()