chore: update Node.js version to 24-slim in Dockerfile #23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Deploy Docker Image | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| driver-opts: | | |
| network=host | |
| - name: Log in to Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Prepare image metadata | |
| id: prep | |
| run: | | |
| IMAGE_NAME="ghcr.io/${{ github.repository_owner }}/${{ github.repository }}" | |
| IMAGE_NAME="$(echo "${IMAGE_NAME}" | tr '[:upper:]' '[:lower:]')" | |
| echo "image_name=${IMAGE_NAME}" >> "${GITHUB_OUTPUT}" | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: | | |
| ${{ steps.prep.outputs.image_name }}:latest | |
| ${{ steps.prep.outputs.image_name }}:${{ github.sha }} | |
| deploy-railway: | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/railwayapp/cli:latest | |
| needs: build-and-push | |
| env: | |
| SVC_ID_COLLECTOR: ${{ vars.RAILWAY_ID_COLLECTOR }} | |
| SVC_ID_PRICES: ${{ vars.RAILWAY_ID_PRICES }} | |
| SVC_ID_OTOKEN: ${{ vars.RAILWAY_ID_OTOKEN }} | |
| RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Trigger Railway redeployments | |
| run: | | |
| railway redeploy -y -s ${{ env.SVC_ID_COLLECTOR }} | |
| railway redeploy -y -s ${{ env.SVC_ID_PRICES }} | |
| railway redeploy -y -s ${{ env.SVC_ID_OTOKEN }} |