Skip to content

Merge pull request #5 from Killpit/master #1

Merge pull request #5 from Killpit/master

Merge pull request #5 from Killpit/master #1

Workflow file for this run

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