This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Push Docker image | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'app/**' | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./app | |
file: ./app/Dockerfile | |
push: true | |
tags: ehdgns8227/back-api:${{ github.sha }} | |
# tags: ehdgns8227/back-api:latest |