diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 211e5fb..a425663 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: @@ -31,11 +35,12 @@ jobs: path: build/libs/ build-docker: - runs-on: [ubuntu-latest] - needs: [build-gradle] + runs-on: [ ubuntu-latest ] + needs: [ build-gradle ] 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 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a584a5f..6e18110 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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/ \ No newline at end of file