Skip to content

Add single region publishing to publish script #69

Add single region publishing to publish script

Add single region publishing to publish script #69

Workflow file for this run

name: Node CI
# Push tests pushes; PR tests merges
on: [ push, pull_request ]
defaults:
run:
shell: bash
jobs:
# Test the build
build:
# Setup
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [ 14.x, 16.x, 18.x ]
os: [ ubuntu-latest, macOS-latest ]
# Go
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Env
run: |
echo "Event name: ${{ github.event_name }}"
echo "Git ref: ${{ github.ref }}"
echo "GH actor: ${{ github.actor }}"
echo "SHA: ${{ github.sha }}"
VER=`node --version`; echo "Node ver: $VER"
VER=`npm --version`; echo "npm ver: $VER"
- name: Install
run: npm install
- name: Build
run: npm run build
- name: Test
run: npm test
env:
CI: true
publish:
# Setup
needs: build
runs-on: ubuntu-latest
# Go
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install
run: npm install
- name: Build
run: npm run build
- name: Staging deploy
if: github.ref == 'refs/heads/main'
run: npm run publish
env:
CI: true
LAYER_NAME: begin-telemetry-staging
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
- name: Production deploy
if: startsWith(github.ref, 'refs/tags/v')
run: npm run publish
env:
CI: true
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}