Merge pull request #13 from platzi/amines/12 #2
This file contains hidden or 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: API Contactos CI/CD | |
on: | |
push: | |
branches: [ "main" ] | |
env: | |
IMAGE_BASE_NAME: aminespinoza/apicontactos | |
jobs: | |
API_Image: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: src/ContactosAPI | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Build Docker NET image | |
run: | | |
docker build --platform linux -t $IMAGE_BASE_NAME . | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Deploy image to hub | |
run: | | |
docker push $IMAGE_BASE_NAME:latest |