🤖 Change ci

This commit is contained in:
SebClem 2022-06-11 18:27:34 +02:00
parent 239781fbbd
commit ccb0c6eee8
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50
2 changed files with 17 additions and 6 deletions

View File

@ -5,9 +5,6 @@ name: Build
on: on:
push: push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs: jobs:
build-gradle: build-gradle:
@ -38,7 +35,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- build-gradle - build-gradle
if: github.ref == 'refs/heads/master'
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -60,10 +56,24 @@ jobs:
username: ${{ github.repository_owner }} username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }} password: ${{ secrets.CR_PAT }}
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5.2
- name: Set tag master
if: steps.branch-name.outputs.current_branch == 'master'
run: |
echo "tag=latest" >> $GITHUB_ENV
- name: Set tag
if: steps.branch-name.outputs.current_branch != 'master'
run: |
echo "tag=${{ steps.branch-name.outputs.current_branch }}" >> $GITHUB_ENV
- name: Build and push Docker - name: Build and push Docker
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
push: true push: true
context: . context: .
tags: ghcr.io/sebclem/claptrapbot:latest tags: "ghcr.io/sebclem/claptrapbot:${{ env.tag }}"
file: ./Dockerfile file: ./Dockerfile

View File

@ -1,5 +1,6 @@
{ {
"extends": [ "extends": [
"config:base" "config:base"
] ],
"commitMessageSuffix": "[skip ci]"
} }