forked from vinhnguyen1211/novu
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (74 loc) · 2.92 KB
/
dev-deploy-embed.yml
File metadata and controls
82 lines (74 loc) · 2.92 KB
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
74
75
76
77
78
79
80
81
82
# This is a basic workflow to help you get started with Actions
name: Deploy DEV EMBED
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
workflow_dispatch:
push:
branches:
- next
paths:
- 'libs/embed/**'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
deploy_embed:
environment: Development
# The type of runner that the job will run on
runs-on: ubuntu-latest
timeout-minutes: 80
if: "!contains(github.event.head_commit.message, 'ci skip')"
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Setup kernel for react native, increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- uses: actions/setup-node@v2
with:
node-version: '16.15.1'
- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/action-setup@v2.0.1
with:
version: 7.5.0
run_install: true
# Runs a single command using the runners shell
- name: Build
run: CI='' npm run build:embed
- name: Build
working-directory: libs/embed
run: CI='' npm run build:dev
- name: Deploy EMBED to DEV
uses: nwtgck/actions-netlify@v1.2
with:
publish-dir: libs/embed/dist
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: dev
production-deploy: true
alias: dev
github-deployment-environment: development
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: 22682666-3a8d-40be-af26-017bfadf5ae9
timeout-minutes: 1
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
REGISTRY_OWNER: novuhq
DOCKER_NAME: novu/embed
IMAGE_TAG: ${{ github.sha }}
GH_ACTOR: ${{ github.actor }}
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
run: |
echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin
docker build -t ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG -f libs/embed/Dockerfile .
docker tag ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:dev
docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:dev
docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG
echo "::set-output name=IMAGE::ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG"