-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (32 loc) · 964 Bytes
/
create-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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