Skip to content

Add Github CI pipeline for building and pushing docker images to ghcr.io #1

Add Github CI pipeline for building and pushing docker images to ghcr.io

Add Github CI pipeline for building and pushing docker images to ghcr.io #1

name: Build Docker image
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- uses: docker/setup-buildx-action@v3
with:
install: true
- name: Login to container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
run: ./gradlew optimizedDockerBuildNative
env:
DOCKER_IMAGE: ghcr.io/jirkavrba/slack-tenor-bot
- name: Push Docker image to container registry
run: docker push ghcr.io/jirkavrba/slack-tenor-bot:latest