fix(ipns): fix db query on article table #425
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: Build & Test | |
on: | |
push: | |
branches-ignore: | |
- develop | |
- main | |
- master | |
- stage | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: ap-southeast-1 | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} | |
ECR_REPOSITORY: lambda-handlers-image | |
jobs: | |
build-and-test: | |
name: Build & Test | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:12-alpine | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_DB: matters-test | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
- run: npm ci | |
- name: Lint | |
run: | | |
npm run lint \ | |
&& npm run format:check | |
- name: Build | |
run: npm run build | |
- name: Test | |
run: npm run test | |
env: | |
MATTERS_ENV: test | |
MATTERS_PG_HOST: localhost | |
MATTERS_PG_USER: postgres | |
MATTERS_PG_PASSWORD: postgres | |
MATTERS_PG_DATABASE: matters-test | |
MATTERS_NEW_FEATURE_TAG_ID: 1 | |
MATTERS_PG_RO_CONNECTION_STRING: postgresql://postgres:postgres@localhost/matters-test | |
MATTERS_CACHE_HOST: localhost | |
MATTERS_TEST_DB_SETUP: 1 | |
build-and-publish: | |
name: Build Lambda-Handlers Docker Image & Publish to AWS ECR | |
needs: build-and-test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup AWS | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Build, tag, and push image to Amazon ECR | |
run: | | |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f Dockerfile . | |
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | |
env: | |
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
IMAGE_TAG: v${{ github.sha }} | |
IMAGE_URI: ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}:v${{ github.sha }} |