Skip to content

Commit

Permalink
added docker deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
KartulUdus committed Nov 6, 2023
1 parent 75c3c02 commit 7d068cb
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Push Docker Image

on:
push:
branches:
- master
- feature/gh-docker-actions

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@v1

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and Push
uses: docker/build-push-action@v2
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mc-chat-parser",
"version": "1.0.1",
"version": "1.2.1",
"description": "app that follows docker logs and passes chat messages between minecraft and discord",
"main": "./src/app.js",
"type": "commonjs",
Expand Down

0 comments on commit 7d068cb

Please sign in to comment.