feat(data-exporter): add Houdini daily practice day 211 #239
This file contains hidden or 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: Export Data | |
on: | |
push: | |
paths: | |
- 'data-exporter/**' | |
- '.github/workflows/data-exporter.yml' | |
defaults: | |
run: | |
working-directory: data-exporter | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Install Node v16 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
- name: Cache ~/.npm | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install NPM dependencies | |
run: npm ci | |
- name: Build tool | |
run: npm run build | |
- name: 'Upload Build Artifacts' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: prod-dist | |
path: data-exporter/dist | |
if-no-files-found: error | |
deploy-prod: | |
environment: Production | |
needs: [build] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Install Node v16 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
- name: Cache ~/.npm | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install NPM dependencies | |
run: npm ci | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Download a single artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: prod-dist | |
path: data-exporter/dist | |
- name: Sync data | |
run: npm run start |