Skip to content

Commit

Permalink
Merge pull request #6 from dvillavicencio/create-deployment-pipeline
Browse files Browse the repository at this point in the history
Create deployment pipeline
  • Loading branch information
dvillavicencio authored Nov 2, 2023
2 parents c469b94 + 2619b82 commit b5091f6
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Deployment to EC2

on:
workflow_dispatch:

jobs:
build-and-package:
runs-on: ubuntu-latest
steps:
- name: Checkout the project
uses: actions/checkout@v4

- name: Set up JDK 17 for x64
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
architecture: x64

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run the Gradle Build
run: ./gradlew clean build

- name: Archive build JARs
uses: actions/upload-artifact@v3
with:
name: uploaded-artifact
path: |
/build/libs/destiny2bot-**.jar \
!/build/libs/destiny2bot-**-plain.jar
- name: Set Project name and version as environment variables
run: |
echo "PROJECT_VERSION=$(./gradlew -q version)" >> $GITHUB_ENV \
echo "PROJECT_NAME=$(./gradlew -q projectName)" >> $GITHUB_ENV
- name: Verify environment variables
run: |
echo {{ env.PROJECT_VERSION }} \
echo {{ env.PROJECT_NAME }}
# dockerize-and-upload:
# needs: build-and-package

# runs-on: ubuntu-latest
# steps:
# - name: Login to Docker
# uses: docker@login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

# - name: Build and Push
# uses: docker/build-push-action@v5
9 changes: 9 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,12 @@ tasks.named('asciidoctor') {
inputs.dir snippetsDir
dependsOn test
}

tasks.register('version') {
println project.version
}

tasks.register('projectName') {
println project.name
}

0 comments on commit b5091f6

Please sign in to comment.