From a08a021b76b9900a52a783bde98242120c16dbdb Mon Sep 17 00:00:00 2001 From: SrIzan10 <66965250+SrIzan10@users.noreply.github.com> Date: Tue, 19 Jul 2022 20:56:26 +0200 Subject: [PATCH] dockerfile and ci added --- .github/workflows/dockerpush.yml | 19 +++++++++++++++++++ Dockerfile | 13 +++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/dockerpush.yml create mode 100644 Dockerfile diff --git a/.github/workflows/dockerpush.yml b/.github/workflows/dockerpush.yml new file mode 100644 index 0000000..0d518f8 --- /dev/null +++ b/.github/workflows/dockerpush.yml @@ -0,0 +1,19 @@ +name: Push to docker. +on: [push] # When pushing to any branch then run this action +# Env variable +env: + DOCKER_USER: ${{secrets.DOCKER_USER}} + DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} + REPO_NAME: ${{secrets.REPO_NAME}} +jobs: + push-image-to-docker-hub: # job name + runs-on: ubuntu-latest # runner name : (ubuntu latest version) + steps: + - uses: actions/checkout@v2 # first action : checkout source code + - name: docker login + run: | # log into docker hub account + docker login -u $DOCKER_USER -p $DOCKER_PASSWORD + - name: Build the Docker image # push The image to the docker hub + run: docker build . --file Dockerfile --tag $DOCKER_USER/$REPO_NAME:latest + - name: Docker Push + run: docker push $DOCKER_USER/$REPO_NAME:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5c881d6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:alpine + +RUN apk update + +RUN apk add openjdk13 wget + +RUN mkdir /lavalink + +RUN cd /lavalink && wget https://github.com/freyacodes/Lavalink/raw/master/LavalinkServer/application.yml.example -O application.yml + +RUN cd /lavalink && wget https://ci.fredboat.com/repository/download/Lavalink_Build/9447:id/Lavalink.jar + +CMD cd /lavalink && java -jar Lavalink.jar \ No newline at end of file