Update docker-image.yml #118
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Build with Gradle | |
uses: gradle/gradle-build-action@v3 | |
with: | |
arguments: build | |
- name: Build the Docker image | |
run: | | |
# docker build . --file Dockerfile --tag cloud-cost-inspector:$(date +%s) | |
docker build . --tag ghcr.io/ankurkumarz/cloud-cost-inspector:latest | |
docker run ghcr.io/ankurkumarz/cloud-cost-inspector:latest | |
docker push ghcr.io/ankurkumarz/cloud-cost-inspector:latest | |