debugging #42
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: Release | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- '*' | |
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 |