Skip to content

fix(api): improve logging #994

fix(api): improve logging

fix(api): improve logging #994

Workflow file for this run

name: Publish Docker image
on:
push:
branches: [main]
tags: [v*]
pull_request:
types: [opened, synchronize]
jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
package:
- apps/api
- apps/twap
- apps/notification-producer
- apps/telegram
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Setup dependencies
uses: ./.github/workflows/actions/setup-dependencies
- name: Write commit hash in the assets directory
run: echo -n "${{ github.sha }}" > assets/git-commit-hash.txt
- run: yarn build
- name: Set up Docker Buildx
id: setup-buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
- name: Login to GitHub Container Registry
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract package name
run: echo "PACKAGE_NAME=$(basename ${{ matrix.package }})" >> $GITHUB_ENV
- name: 'Image metadata for ${{ env.PACKAGE_NAME }}'
id: image_meta
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
with:
images: ghcr.io/${{ github.repository }}/${{ env.PACKAGE_NAME }}
- name: 'BFF: Build and push ${{ env.PACKAGE_NAME }}'
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
context: .
file: ${{ matrix.package }}/Dockerfile
push: true
tags: ${{ steps.image_meta.outputs.tags }}
labels: ${{ steps.image_meta.outputs.labels }}
builder: ${{ steps.setup-buildx.outputs.name }}
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
# TODO: Disabled as I couldn't get it to work with GH pkgs
# secrets: |
# id=npmrc,src=${{ github.workspace }}/.npmrc
- uses: cowprotocol/autodeploy-action@73f1163f19a584cdc34e29aa84d630d7e6a45432 # v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
images: ghcr.io/cowprotocol/bff/${{ env.PACKAGE_NAME }}:main
url: ${{ secrets.AUTODEPLOY_URL }}
token: ${{ secrets.AUTODEPLOY_TOKEN }}
timeout: 600000 # 10 minutes