Skip to content

Commit

Permalink
Redeploy 'latest' on railway when there is a release. (#113)
Browse files Browse the repository at this point in the history
The railway.app project is configured to use the 'latest' of the
uploaded docker images. The 'latest' tag is updated for releases, and a
'redeploy' will thus run the latest released docker image.
  • Loading branch information
floitsch authored Sep 19, 2024
1 parent 1eef495 commit e92af41
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,16 @@ on:
required: false
default: false
type: boolean
redeploy:
description: 'Redeploy the container on railway'
required: false
default: false
type: boolean

env:
DOCKER_NAME: tpkg_registry
RAILWAY_PROJECT_ID: 6580ada5-829d-4c2a-8b84-0096bd87b421
RAILWAY_SERVICE_ID: d9ab2b13-9265-4757-97eb-282ac85f15fc

jobs:
build:
Expand Down Expand Up @@ -111,3 +118,15 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: .

- name: Install Railway
if: github.event.inputs.redeploy == 'true' || github.event_name == 'release'
run: npm i -g @railway/cli

- name: Deploy
if: github.event.inputs.redeploy == 'true' || github.event_name == 'release'
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
run: |
railway link --project-id $RAILWAY_PROJECT_ID --service $RAILWAY_SERVICE_ID
railway redeploy -y

0 comments on commit e92af41

Please sign in to comment.