Switch to github cr

This commit is contained in:
Sebastien Clement 2021-02-18 15:21:59 +01:00
parent b8a12a061f
commit e36bd805ea
2 changed files with 25 additions and 9 deletions

View File

@ -16,14 +16,18 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- 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:
@ -36,6 +40,7 @@ jobs:
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- name: Download artifact
uses: actions/download-artifact@v1.0.0
with:
@ -43,11 +48,21 @@ jobs:
name: claptrap_jar
# Destination path
path: build/libs/
- name: Publish Docker
uses: elgohr/Publish-Docker-Github-Action@master
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to ghcr.io
uses: docker/login-action@v1
with:
name: brokenfire/brokendiscordbot
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: latest,${{ env.GITHUB_RUN_ID}}
buildargs: GITHUB_RUN_NUMBER=${{env.RELEASE_VERSION}}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build and push Docker
uses: docker/build-push-action@v2
with:
push: true
context: .
tags: ghcr.io/sebclem/claptrapbot:latest, ghcr.io/sebclem/claptrapbot:${{ env.GITHUB_RUN_ID}}
file: ./Dockerfile

View File

@ -9,3 +9,4 @@ RUN java -version
ENV PORT=8080
ENV TOKEN=10
CMD java -jar bot.jar -t ${TOKEN}
LABEL org.opencontainers.image.source=https://github.com/Sebclem/ClaptrapBot/