forked from iam-veeramalla/three-tier-architecture-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (34 loc) · 1.08 KB
/
cart.yaml
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
name: Cart
on:
push:
branches:
- master
paths:
- '**.js' # Only trigger on changes to Python files (**.py)
- '.github/workflows/cart.yaml' # Include workflow file changes
pull_request:
branches:
- master
paths:
- '**.js' # Only trigger on changes to Python files (**.py)
- '.github/workflows/cart.yaml' # Include workflow file changes
jobs:
payment:
name: Build and deploy cart microservice
runs-on: [self-hosted] # Use a standard runner instead of self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: NPM install
run: npm install
- name: Build Docker image
run: |
docker build -t cart . # Build image tagged as 'payment' from current directory
- name: Docker Login (use secrets)
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Push
run: |
docker tag cart ${name}/cart:latest
docker push ${name}/cart:latest