This repository has been archived by the owner on Dec 29, 2023. It is now read-only.
Don't move user #421
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a Java project with Gradle | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
name: Build | |
on: | |
push: | |
branches-ignore: | |
- "renovate/**" | |
tags-ignore: | |
- "**" | |
jobs: | |
build-gradle: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew build | |
- name: Upload Jar File | |
uses: actions/upload-artifact@v2-preview | |
with: | |
name: claptrap_jar | |
path: build/libs/ | |
build-docker: | |
runs-on: ubuntu-latest | |
needs: | |
- build-gradle | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download artifact | |
uses: actions/download-artifact@v3.0.2 | |
with: | |
# Artifact name | |
name: claptrap_jar | |
# Destination path | |
path: build/libs/ | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to ghcr.io | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v5.4 | |
- name: Set tag | |
run: | | |
echo "tag=${{ steps.branch-name.outputs.current_branch }}" >> $GITHUB_ENV | |
- name: Build and push Docker | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
context: . | |
tags: "ghcr.io/sebclem/claptrapbot:${{ env.tag }}" | |
file: ./Dockerfile |