Skip to content

Merge pull request #21 from KartulUdus/feature/10-readme-and-setup #5

Merge pull request #21 from KartulUdus/feature/10-readme-and-setup

Merge pull request #21 from KartulUdus/feature/10-readme-and-setup #5

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches:
- master
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check Out Repository
uses: actions/checkout@v3
- name: Load package.json version
id: package_version
run: echo "PACKAGE_VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/minecraft-discord-chat-parser:latest
${{ secrets.DOCKERHUB_USERNAME }}/minecraft-discord-chat-parser:${{ env.PACKAGE_VERSION }}
- name: Logout from Docker Hub
run: docker logout