-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (38 loc) · 1.25 KB
/
development.yml
File metadata and controls
48 lines (38 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: CI/CD Pipeline for development branch
on:
push:
branches:
- development
pull_request:
branches:
- development
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: development
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Configure Node.js
uses: actions/setup-node@v2
with:
node-version: "20"
- name: Install dependencies
run: npm ci
working-directory: ./myappi
- name: Build Docker image
run: docker build -t ${{ secrets.DOCKER_USERNAME }}/TestArenaAPIDev:latest .
working-directory: ./backend
- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Push Docker image to Docker Hub
run: docker push ${{ secrets.DOCKER_USERNAME }}/TestArenaAPIDev:latest
# install railway cli
- name: Install Railway CLI
run: npm install -g @railway/cli
# deploy to railway
- name: Deploy to Railway
run: railway up --service ${{ secrets.RAILWAY_SERVICE_NAME}}
working-directory: ./backend
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}