Merge pull request #1233 from searchspring/develop #257
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: Publish | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
Publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repositiory | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: "0" | |
- name: Set Github credentials | |
run: | | |
git config user.name searchspring-machine | |
git config user.email machine@searchspring.com | |
- name: Setup Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Cache node modules | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install packages | |
run: npm ci | |
- name: Build | |
run: | | |
npm run build | |
- name: Tests | |
env: | |
NODE_OPTIONS: "--max-old-space-size=4096" | |
run: npm run test | |
- name: Publish packages | |
run: npm run publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.SNAPFU_AWS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.SNAPFU_AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Generate Metrics Files | |
run: npm run build:metrics | |
- name: Upload Metrics Files to S3 | |
run: aws s3 sync --region us-east-1 ./metrics/data s3://datawarehouse-stage/team-metrics-import/ |