Skip to content

Create docker-publish.yml #3

Create docker-publish.yml

Create docker-publish.yml #3

name: Build and Push Docker Image
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Docker image
run: |
docker build -t 34v0wphix/new-api:${{ github.sha }} .
docker tag 34v0wphix/new-api:${{ github.sha }} 34v0wphix/new-api:latest
- name: Push Docker image
run: |
docker push 34v0wphix/new-api:${{ github.sha }}
docker push 34v0wphix/new-api:latest