Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy apollo to railway #172

Merged
merged 7 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 30 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ env:
DOCKER_REGISTRY: ghcr.io

jobs:
publish-indexer:
name: Publish indexer
publish-docker-image:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -36,20 +36,20 @@ jobs:
uses: docker/build-push-action@v3
with:
push: true
context: .
file: apollo/Dockerfile
context: apollo
tags: |
${{ env.DOCKER_REGISTRY }}/${{ github.repository }}/apollo:sha-${{ steps.short-sha.outputs.sha }}
${{ env.DOCKER_REGISTRY }}/${{ github.repository }}/apollo:staging

- name: Build apollo with tag
uses: docker/build-push-action@v3
if: startsWith(github.ref, 'refs/tags/v')
with:
push: true
context: .
file: apollo/Dockerfile
context: apollo
tags: |
${{ env.DOCKER_REGISTRY }}/${{ github.repository }}/apollo:${{ steps.tag-name.outputs.tag }}
${{ env.DOCKER_REGISTRY }}/${{ github.repository }}/apollo:latest

- name: Build ponder with sha
uses: docker/build-push-action@v3
Expand All @@ -58,6 +58,7 @@ jobs:
context: ponder/lnv3
tags: |
${{ env.DOCKER_REGISTRY }}/${{ github.repository }}/ponder:sha-${{ steps.short-sha.outputs.sha }}
${{ env.DOCKER_REGISTRY }}/${{ github.repository }}/ponder:staging

- name: Build ponder with tag
uses: docker/build-push-action@v3
Expand All @@ -67,5 +68,28 @@ jobs:
context: ponder/lnv3
tags: |
${{ env.DOCKER_REGISTRY }}/${{ github.repository }}/ponder:${{ steps.tag-name.outputs.tag }}
${{ env.DOCKER_REGISTRY }}/${{ github.repository }}/ponder:latest

deploy-railway:
name: Deploy railway
runs-on: ubuntu-latest
needs: [publish-docker-image]
steps:
- uses: actions/checkout@v2

- name: Deploy apollo-prd
uses: fewensa/action-railway-redeploy@main
if: startsWith(github.ref, 'refs/tags/v')
with:
railway_token: ${{ secrets.RAILWAY_TOKEN }}
environment_id: "97eba9bb-0d0e-43ce-a9c1-5ea78b7891ef"
service_id: "15b7ef1b-90f0-4fae-8404-97a4d790c271"

- name: Deploy apollo-stg
uses: fewensa/action-railway-redeploy@main
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
with:
railway_token: ${{ secrets.RAILWAY_TOKEN }}
environment_id: "97eba9bb-0d0e-43ce-a9c1-5ea78b7891ef"
service_id: "07ce396e-d868-459e-a0f2-5563483d7aba"

10 changes: 5 additions & 5 deletions apollo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
FROM node:14-alpine
FROM node:21-alpine

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

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

WORKDIR /opt/indexer
WORKDIR /app

EXPOSE 4002

ENV VERSION_MODE prod

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

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