Skip to content

Commit

Permalink
Merge pull request #26 from shayaantx/feature/github-actions
Browse files Browse the repository at this point in the history
Add github actions, remove jenkins + app veyor for builds/deployment,
  • Loading branch information
shayaantx authored Jan 26, 2021
2 parents 5b8e541 + fa225ed commit 7962687
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 612 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/development-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: pull-request
on:
push:
branches:
- 'development'
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup java
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
install: true
version: latest
driver-opts: image=moby/buildkit:master
- name: Get version
run: |
VERSION=$(cat src/main/resources/version.txt)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Building $VERSION"
- name: Build
run: mvn --no-transfer-progress compile
- name: Test
run: mvn --no-transfer-progress test
- name: Package
run: mvn --no-transfer-progress package -DskipTests
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: ${{ env.VERSION }}
body: |
${{ env.GITHUB_SHA }}
draft: false
prerelease: false
- name: Upload Artifact to Github Release
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/botdarr-release.jar
asset_name: botdarr-release.jar
asset_content_type: application/jar
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: |
shayaantx/botdarr:latest
shayaantx/botdarr:${{ env.VERSION }}
28 changes: 28 additions & 0 deletions .github/workflows/feature-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: pull-request
on:
push:
branches:
- '**'
- '!development'
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup java
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Get version
run: |
VERSION=$(cat src/main/resources/version.txt)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Building $VERSION"
- name: Build
run: mvn --no-transfer-progress compile
- name: Test
run: mvn --no-transfer-progress test
- name: Package
run: mvn --no-transfer-progress package -DskipTests
6 changes: 1 addition & 5 deletions DockerfileUpload → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
FROM centos:7
RUN yum update; yum clean all; yum -y install java-1.8.0-openjdk-devel.x86_64;
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk
ENV PATH=$PATH:$JAVA_HOME/bin

FROM openjdk:8
RUN mkdir -p /home/botdarr
ADD target/botdarr-release.jar /home/botdarr

Expand Down
132 changes: 0 additions & 132 deletions Jenkinsfile

This file was deleted.

16 changes: 0 additions & 16 deletions appveyor.yml

This file was deleted.

Loading

0 comments on commit 7962687

Please sign in to comment.