Skip to content

Update docker-publish.yml #15

Update docker-publish.yml

Update docker-publish.yml #15

name: Build Docker Image
on:
push:
branches:
- master
jobs:
build:
name: push docker image to docker hub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: login to docker hub
id: docker-hub
env:
username: ${{vars.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_PASSWORD}}
run: |
docker login -u $username -p $password
- name: build the docker image
id: build-docker-image
run: |
ls -la
docker build . -f Dockerfile -t narmidm/k8s-pod-cpu-stressor:latest
- name: push the docker image
id: push-docker-image
run: docker push ${{vars.DOCKERHUB_USERNAME}}/k8s-pod-cpu-stressor:latest