We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bd591fd commit 517f2b9Copy full SHA for 517f2b9
1 file changed
.github/workflows/docker-image.yml
@@ -0,0 +1,26 @@
1
+name: Docker Build and Push
2
+
3
+on:
4
+ push:
5
+ branches:
6
+ - github-actions # Change this to the branch you want to trigger the action on
7
8
+jobs:
9
+ build-and-push:
10
+ runs-on: ubuntu-latest
11
12
+ steps:
13
+ - name: Checkout code
14
+ uses: actions/checkout@v2
15
16
+ - name: Login to Docker Hub
17
+ run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
18
19
+ - name: Build and Push Docker Image
20
+ env:
21
+ DOCKER_IMAGE_TAG: "my-docker-image:latest" # Change this to your desired image tag
22
+ run: |
23
+ docker build -t $DOCKER_IMAGE_TAG .
24
+ docker tag $DOCKER_IMAGE_TAG ${{ secrets.DOCKERHUB_USERNAME }}/$DOCKER_IMAGE_TAG
25
+ docker push ${{ secrets.DOCKERHUB_USERNAME }}/$DOCKER_IMAGE_TAG
26
0 commit comments