PSF-BotServer/.github/workflows/publish.yaml
Resaec 50f69784c0
Update GitHub Action to fix broken pipeline (#1301)
* update github workflow to fix broken pipeline

* switch to sbtn command, seems like no sbt -> sbtn link is provided anymore
might just work like is...

* nope, not the link is missing, it does not pack sbt at all
does switching to sbt proper work?

* update JVM to latest LTS

* Revert "update JVM to latest LTS"

This reverts commit 75baaa52e86f88d596d98d656824672aa4e25cdf.
2025-08-29 15:15:13 +00:00

43 lines
1.3 KiB
YAML

name: Publish Docker Image
on:
push:
branches:
- master
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set variables
id: prep
run: |
DOCKER_IMAGE=server
REPOSITORY="$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')" # Repository name must be lowercase in image tags
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
GITHUB_SHA=$(jq -r .pull_request.head.sha < "$GITHUB_EVENT_PATH") # GITHUB_SHA is the merge SHA, not the head commit SHA in a PR, replace it.
fi
TAGS="ghcr.io/${REPOSITORY}/${DOCKER_IMAGE}:${GITHUB_SHA}"
if [ "${GITHUB_REF}" = "refs/heads/master" ]; then
TAGS="$TAGS,ghcr.io/${REPOSITORY}/${DOCKER_IMAGE}:latest,ghcr.io/${REPOSITORY}/${DOCKER_IMAGE}:master"
fi
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push container image
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ steps.prep.outputs.tags }}