-
Notifications
You must be signed in to change notification settings - Fork 294
52 lines (43 loc) · 1.17 KB
/
docker-backend-image.yml
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
49
50
51
name: Deploy Back Docker
on:
push:
branches:
- master
paths:
- 'backend/**'
pull_request:
branches:
- master
paths:
- 'backend/**'
jobs:
deploy_back:
if: github.repository == 'ldurans/izing.open.io'
runs-on: ubuntu-22.04
environment: production
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Use Node.js"
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: "Verify Node.js version"
run: node -v
- name: Build Backend
run: |
cd backend
npm install
export NODE_OPTIONS="--max_old_space_size=4096"
CI=false npm run build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: izingopenio
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push Docker image
run: |
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm64 -t izingopenio/izingopenio-backend:latest --push ./backend