1- name : Build and publish a Docker image to GHCR
1+ name : Build and push to Docker Hub
22
33on :
44 push :
55 branches : ['main']
66
7- env :
8- REGISTRY : ghcr.io
9- IMAGE_NAME : ${{ github.repository }}
10-
117jobs :
128
139 build-and-push-image :
14- name : Build and push Docker image to GitHub Container Registry
10+ name : Build and push to Docker Hub
1511 runs-on : ubuntu-latest
16- permissions :
17- contents : read
18- packages : write
1912 steps :
20- - name : Checkout repository
13+ - name : Checkout
2114 uses : actions/checkout@v3
22- - name : Log in to the Container registry
23- uses : docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
24- with :
25- registry : ${{ env.REGISTRY }}
26- username : ${{ github.actor }}
27- password : ${{ secrets.GITHUB_TOKEN }}
28- - name : Extract metadata (tags, labels) for Docker
29- id : meta
30- uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
15+ - name : Login to Docker Hub
16+ uses : docker/login-action@v2
3117 with :
32- images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
33- - name : Build and push Docker image
34- uses : docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
18+ username : ${{ secrets.DOCKERHUB_USERNAME }}
19+ password : ${{ secrets.DOCKERHUB_TOKEN }}
20+ - name : Set up Docker Buildx
21+ uses : docker/setup-buildx-action@v2
22+ - name : Build and push
23+ uses : docker/build-push-action@v4
3524 with :
3625 context : .
26+ file : ./Dockerfile
3727 push : true
38- tags : ${{ steps.meta.outputs.tags }}
39- labels : ${{ steps.meta.outputs.labels }}
28+ tags : ${{ secrets.DOCKERHUB_USERNAME }}/parseable:edge
0 commit comments