forked from platzi/git-github
-
Notifications
You must be signed in to change notification settings - Fork 0
28 lines (23 loc) · 825 Bytes
/
docker.yml
File metadata and controls
28 lines (23 loc) · 825 Bytes
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
name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
name: Docker build
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build the Docker image
# ¡Línea corregida para usar la ruta CI/Dockerfile y el contexto CI/!
run: docker build --platform linux --tag ${{ secrets.DOCKERHUB_USERNAME }}/backenddockerci:latest -f CI/Dockerfile CI/
- name: Push the Docker image
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/backenddockerci:latest