Skip to content

upload to docker hub #53

upload to docker hub

upload to docker hub #53

name: Docker Compose Build and Publish
on:
push:
branches:
- master
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push Docker image
uses: docker/compose-action@v2
with:
compose-file: docker-compose.yml
push: true
tags: latest
- name: Log into Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image with Buildx
uses: docker/build-push-action@v2
with:
context: .
file: docker-compose.yml
tags: ${{ secrets.DOCKER_USERNAME }}/your-image-name:latest