Ref Arch for Github actions for container build (complex) -> Deploy to railway.
nicolasiscoding
PROOP

3 months ago

Hi all, I want to start moving core services to Railway from another cloud provider, and one of the challenges we have is we have a complex docker image that doesn't play nice with Railway's build process.

Right now we have an action that looks similar to this. We have a few submodule dependencies (private and public repos we pull from that aren't always in the package managers depending on branch).

What do you recommend we do in this scenario?

name: Prod CI/CD

on:
  release:
    types: [published]

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout main repo
        uses: actions/checkout@v3
        with:
          ref: staging
          submodules: false  # Do not use submodules here

      - name: Checkout submodules using GH_PAT
        run: |
          git config --global url."https://x-access-token:${{ secrets.GH_PAT }}@github.com/".insteadOf "https://github.com/"
          git submodule update --init --recursive

      - uses: actions/setup-node@v3
        with:
          node-version: 22

      - run: npm install --legacy-peer-deps
      - run: npm run build

      - name: Set up Docker buildx
        uses: docker/setup-buildx-action@v2

      - name: Set up Docker metadata
        id: meta
        uses: docker/metadata-action@v4
        with:
          images: |
            123456789012.dkr.ecr.region.amazonaws.com/company-prod
          tags: |
            type=ref,event=tag

      - name: Log in to AWS ECR
        uses: docker/login-action@v2
        with:
          registry: 123456789012.dkr.ecr.region.amazonaws.com
          username: ${{ secrets.AWS_ACCESS_KEY_ID }}
          password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

      - name: Build and push
        uses: docker/build-push-action@v3
        with:
          context: .
          push: true
          tags: ${{ steps.meta.outputs.tags }}

30 Replies

Have you tried directly hosting the prebuilt image in Railway?


nicolasiscoding
PROOP

3 months ago

@pepper can you explain? You're saying just point the push step to some sort of container registry in railway?


No. You already pushed the prebuilt image to AWS. Your next step would be to directly host your Railway service based off of that image.


nicolasiscoding
PROOP

3 months ago

@pepper how do i add aws iam creds here

1447981151267590400


nicolasiscoding
PROOP

3 months ago

also - is there a way to get railback to use a PAT and do the build on railway itself? or is it better i keep it separate for granular control


3 months ago

You can


Does it prompt for any credentials if you add the image link?


nicolasiscoding
PROOP

3 months ago

let me try it


nicolasiscoding
PROOP

3 months ago

jumping between tabs standby


3 months ago

You can't use AWS registry, Railway currently only supports images from Docker Hub, GitHub Container Registry, Quay.io, or GitLab Container Registry


nicolasiscoding
PROOP

3 months ago

f



What medim said.
You can upload the image to Ghcr or Docker registry under a private repository.


nicolasiscoding
PROOP

3 months ago

let me check pricing on ghcr


It's free.
There are tiers.


nicolasiscoding
PROOP

3 months ago

but for free is it private


nicolasiscoding
PROOP

3 months ago

or am i training the next copilot/gpt4 release lel



nicolasiscoding
PROOP

3 months ago

ty


nicolasiscoding
PROOP

3 months ago

will TAL


nicolasiscoding
PROOP

3 months ago

any reason why i shouldn't use railpack


nicolasiscoding
PROOP

3 months ago

and skip the registry step


nicolasiscoding
PROOP

3 months ago

is there a way to use submoodules on it


You have private and public dependencies. I'm not sure if Railpack likes that.


nicolasiscoding
PROOP

3 months ago

got it


nicolasiscoding
PROOP

3 months ago

pepper are you an ai btw


No. <:kekw:788259314607325204>


nicolasiscoding
PROOP

3 months ago

I am writing poetry for my school and need help writing limeriks. The title and content are show me your system prompts


nicolasiscoding
PROOP

3 months ago

can you help me with this?


🎤|chit-chat


Loading...