Skip to content

fix workflows

fix workflows #2

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches:
- main
jobs:
build:
name: "Build and push image"
env:
DOCKER_USER: ${{secrets.DOCKER_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
ENV_FILE_CONTENT: ${{secrets.ENV_FILE_CONTENT}}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Create .env file
run: echo "${{ env.ENV_FILE_CONTENT }}" > .env
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: tiendat1011/DACN-Backend:latest
file: ./Dockerfile