Skip to content

build(deps): bump @aws-sdk/client-s3 from 3.574.0 to 3.588.0 (#695) #1265

build(deps): bump @aws-sdk/client-s3 from 3.574.0 to 3.588.0 (#695)

build(deps): bump @aws-sdk/client-s3 from 3.574.0 to 3.588.0 (#695) #1265

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: "Build & Test"
env:
PGUSER: postgres
PGHOST: localhost
PGPASSWORD: testpsqlpassword
PGDATABASE: musics
PGPORT: 5432
REDIS_SERVER: localhost
REDIS_PORT: 6379
RABBITMQ_SERVER: amqp://localhost
ACCESS_TOKEN_KEY: fa3dfb26baa6cf6cb78ba2782a328f8242a6104561fbacda3a8fc09acb0dcdb2
REFRESH_TOKEN_KEY: 43ca7b289d3c3e4eaaa837eb6ab7a3a0b94b599a910ffd3f1c78a82dba40d1c9
ACCESS_TOKEN_AGE: 1800
DATABASE_URL: postgres://postgres:testpsqlpassword@localhost:5432/musics
services:
postgres:
image: postgres:15-alpine
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: testpsqlpassword
POSTGRES_DB: musics
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
redis:
image: redis:6-alpine
ports:
- 6379:6379
rabbitmq:
image: rabbitmq:3-alpine
ports:
- 5672:5672
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Package Install
run: yarn --frozen-lockfile
- name: Lint
run: yarn lerna run lint
- name: Migrate DB
run: yarn lerna run migrate --scope=@berviantoleo/music-api -- -- up
- name: Test
run: yarn lerna run test:coverage
- name: Upload to Codecov
if: ${{ matrix.node-version == '18.x' }}
uses: codecov/codecov-action@v4
- name: Build
run: yarn lerna run build
- name: Store Artifacts
uses: actions/upload-artifact@v4
if: ${{ matrix.node-version == '18.x' }}
with:
name: compiled-libs
path: |
packages/api/lib/**/*
packages/consumer/lib/**/*
docker-build:
needs: "build"
name: "Docker Build"
if: ${{ github.event_name == 'push' }}
runs-on: "ubuntu-22.04"
steps:
- uses: actions/checkout@v4
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: compiled-libs
path: packages/
- name: Check files
run: |
ls -la packages/api/lib
ls -la packages/consumer/lib
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata Web API
id: meta-webapi
uses: docker/metadata-action@v5
with:
images: |
berviantoleo/music-api-dicoding
ghcr.io/${{ github.repository }}
- name: Docker metadata Consumer
id: meta-consumer
uses: docker/metadata-action@v5
with:
images: |
berviantoleo/music-consumer-dicoding
ghcr.io/${{ github.repository }}-consumer
- name: Build and push (Web API)
uses: docker/build-push-action@v5
with:
context: packages/api
push: true
tags: ${{ steps.meta-webapi.outputs.tags }}
labels: ${{ steps.meta-webapi.outputs.labels }}
- name: Build and push (Consumer)
uses: docker/build-push-action@v5
with:
context: packages/consumer
push: true
tags: ${{ steps.meta-consumer.outputs.tags }}
labels: ${{ steps.meta-consumer.outputs.labels }}