Created
April 6, 2023 09:19
-
-
Save hasnainmakada-99/7f9b7bcec51fb4f2fa4dd0151a445ecc to your computer and use it in GitHub Desktop.
Dockerfile for creating a hello-world app as an Image
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 Publish Docker Image to Docker Hub | |
on: | |
push: | |
branches: ["main"] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: DockerHub Login | |
uses: docker/login-action@v2.1.0 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Build the Docker image | |
run: docker build . --file Dockerfile --tag ${{ secrets.DOCKERHUB_USERNAME }}/hello-world | |
- name: Docker Push | |
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/hello-world |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment