-
Notifications
You must be signed in to change notification settings - Fork 13
74 lines (69 loc) · 2.13 KB
/
release.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
74
name: Release
on:
push:
branches:
- master
pull_request:
branches:
- '*'
workflow_dispatch:
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
build:
if: github.ref != 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build process
uses: devcontainers/[email protected]
with:
runCmd: |
npm ci
npm run build
release:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
- uses: actions/checkout@v3
- name: Install dependencies
run: |
npm ci
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/[email protected]
with:
# these commands build & tests as well
publish: npm run turbo:ci:publish
version: npm run turbo:ci:version
commit: 'chore: release'
title: 'chore: release'
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Deploy new version
if: steps.changesets.outputs.published == 'true'
uses: devcontainers/[email protected]
env:
TF_VAR_elastic_host: ${{ secrets.TF_VAR_elastic_host }}
TF_VAR_elastic_password: ${{ secrets.TF_VAR_elastic_password }}
TF_VAR_elastic_username: ${{ secrets.TF_VAR_elastic_username }}
TF_VAR_aws_secret_key: ${{ secrets.TF_VAR_aws_secret_key }}
TF_VAR_aws_access_key: ${{ secrets.TF_VAR_aws_access_key }}
TF_TOKEN_app_terraform_io: ${{ secrets.TERRAFORM_CLOUD_TOKEN }}
with:
runCmd: |
npm run deploy:prod
env: |
TF_IN_AUTOMATION=1
TF_VAR_elasticapp=mountainpass-addressr
TF_VAR_elastic_host
TF_VAR_elastic_password
TF_VAR_elastic_username
TF_VAR_aws_secret_key
TF_VAR_aws_access_key
TF_TOKEN_app_terraform_io