Skip to content

Switched to Dockerfile for image building #6

Switched to Dockerfile for image building

Switched to Dockerfile for image building #6

name: buildAndPushImage
on:
push:
branches:
- 'main'
- 'dev'
pull_request:
branches:
- 'main'
env:
IMAGE_NAME: helm-plugin
IMAGE_TAG: ${{ github.ref == 'refs/heads/main' && 'latest' || 'testing' }}
jobs:
build-with-paketo-push-2-dockerhub:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to DockerHub Container Registry
run: echo $DOCKER_HUB_TOKEN | docker login -u well5a --password-stdin
env:
DOCKER_HUB_TOKEN: ${{ secrets.DOCKERHUBTOKEN }}
- name: Build the Docker image
run: docker build . --file Dockerfile --tag well5a/$IMAGE_NAME:$IMAGE_TAG
- name: Push the Docker image
run: docker push well5a/$IMAGE_NAME:$IMAGE_TAG