Skip to content

Commit

Permalink
Merge pull request #158 from helix-bridge/improve-ci
Browse files Browse the repository at this point in the history
Minimise image size
  • Loading branch information
xiaoch05 authored Apr 1, 2024
2 parents 93d3a9c + bc2c67d commit 9d62c15
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
# on:
# pull_request:

env:
DOCKER_REGISTRY: ghcr.io

jobs:
publish-apollo:
name: Publish apollo
Expand All @@ -18,9 +21,9 @@ jobs:
- name: Docker login
uses: docker/login-action@v1
with:
username: ${{ secrets.QUAY_IO_BOT_USERNAME }}
password: ${{ secrets.QUAY_IO_BOT_PASSWORD }}
registry: quay.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.DOCKER_REGISTRY }}

- uses: benjlevesque/[email protected]
id: short-sha
Expand All @@ -31,10 +34,11 @@ jobs:
id: tag-name

- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
file: apollo/Dockerfile
push: true
context: apollo
file: apollo/Dockerfile
tags: |
quay.io/helix-bridge/apollo:sha-${{ steps.short-sha.outputs.sha }}
quay.io/helix-bridge/apollo:${{ steps.tag-name.outputs.tag }}
${{ env.DOCKER_REGISTRY }}/${{ github.repository }}:sha-${{ steps.short-sha.outputs.sha }}
${{ env.DOCKER_REGISTRY }}/${{ github.repository }}:${{ steps.tag-name.outputs.tag }}
8 changes: 4 additions & 4 deletions apollo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
FROM node:14-alpine

COPY . /opt/indexer
COPY . /opt/app

RUN cd /opt/indexer/apollo && \
RUN cd /opt/app && \
yarn install && \
npx prisma generate

WORKDIR /opt/indexer/apollo
WORKDIR /opt/app

EXPOSE 4002

ENV VERSION_MODE prod

# CMD [ "node", "index.js" ]

ENTRYPOINT /opt/indexer/apollo/scripts/entrypoint.sh ${VERSION_MODE}
ENTRYPOINT /opt/app/scripts/entrypoint.sh ${VERSION_MODE}

0 comments on commit 9d62c15

Please sign in to comment.