Implement github actions to build and push the docker image
This commit is contained in:
Skylar Grant 2022-12-02 12:28:32 -05:00 committed by GitHub
parent b9332ec602
commit c5ab2681b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,10 @@ on:
branches: [ "main" ] branches: [ "main" ]
pull_request: pull_request:
branches: [ "main" ] branches: [ "main" ]
env:
DHUB_UNAME: {{ secrets.DHUB_UNAME }}
DHUB_PWORD: {{ secrets.DHUB_PWORD }}
jobs: jobs:
@ -16,4 +20,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Build the Docker image - name: Build the Docker image
run: docker build . --file Dockerfile --tag v0idf1sh/nodbot:$(date +%s) run: docker build . --file Dockerfile --tag v0idf1sh/nodbot:$(date +%s)
run: docker login - name: Log into Docker Hub
run: docker login -u $DHUB_UNAME -p $DHUB_PWORD
- name: Push image to Docker Hub
run: docker push v0idf1sh/nodbot:latest