Update main.tf #31
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 to Docker Hub | |
on: | |
push: | |
branches: | |
- main # Set to the branch name you want to trigger the build. | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v2 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} # Your Docker Hub username. | |
password: ${{ secrets.DOCKERHUB_TOKEN }} # Your Docker Hub token or password. | |
- name: Build and Push Docker image | |
run: | | |
docker build . -t ezio22/cicddemodockerhub:latest | |
docker push ezio22/cicddemodockerhub:latest |