Skip to content

Commit 2c114fe

Browse files
committed
refactor: restructure Railway redeployment step in GitHub Actions workflow
1 parent 75c431e commit 2c114fe

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,18 @@ jobs:
2626
with:
2727
driver-opts: |
2828
network=host
29-
3029
- name: Log in to Container Registry
3130
uses: docker/login-action@v3
3231
with:
3332
registry: ${{ env.REGISTRY }}
3433
username: ${{ github.actor }}
3534
password: ${{ secrets.GITHUB_TOKEN }}
36-
3735
- name: Prepare image metadata
3836
id: prep
3937
run: |
4038
IMAGE_NAME="ghcr.io/${{ github.repository_owner }}/${{ github.repository }}"
4139
IMAGE_NAME="$(echo "${IMAGE_NAME}" | tr '[:upper:]' '[:lower:]')"
4240
echo "image_name=${IMAGE_NAME}" >> "${GITHUB_OUTPUT}"
43-
4441
- name: Build and push Docker image
4542
uses: docker/build-push-action@v5
4643
with:
@@ -51,13 +48,14 @@ jobs:
5148
${{ steps.prep.outputs.image_name }}:latest
5249
${{ steps.prep.outputs.image_name }}:${{ github.sha }}
5350
54-
- name: Trigger Railway redeployments
55-
if: success()
56-
uses: docker://ghcr.io/railwayapp/cli:latest
57-
env:
58-
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
59-
with:
60-
args: |
61-
redeploy --service=${{ secrets.RAILWAY_ID_COLLECTOR }} &&
62-
redeploy --service=${{ secrets.RAILWAY_ID_PRICES }} &&
63-
redeploy --service=${{ secrets.RAILWAY_ID_OTOKEN }}
51+
deploy-railway:
52+
runs-on: ubuntu-latest
53+
container: ghcr.io/railwayapp/cli:latest
54+
env:
55+
SVC_ID_COLLECTOR: ${{ secrets.RAILWAY_ID_COLLECTOR }}
56+
SVC_ID_PRICES: ${{ secrets.RAILWAY_ID_PRICES }}
57+
SVC_ID_OTOKEN: ${{ secrets.RAILWAY_ID_COLLECTOR }}
58+
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
59+
steps:
60+
- uses: actions/checkout@v3
61+
- run: railway up --service=${{ env.SVC_ID_COLLECTOR }} && railway up --service=${{ env.SVC_ID_PRICES }} && railway up --service=${{ env.SVC_ID_OTOKEN }}

0 commit comments

Comments
 (0)