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: Payment
on:
push:
branches:
- master
paths:
- '**.py' # Only trigger on changes to Python files (**.py)
- '.github/workflows/payment.yaml' # Include workflow file changes
pull_request:
branches:
- master
paths:
- '**.py' # Only trigger on changes to Python files (**.py)
- '.github/workflows/payment.yaml' # Include workflow file changes
jobs:
payment:
name: Build and deploy payment 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: Python install
run: sudo apt-get install python3
- name: Build Docker image
run: |
docker build -t payment . # 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 payment ${name}/payment:latest
docker push ${name}/payment:latest