Skip to content

Commit

Permalink
Also publish via GitHub container registry
Browse files Browse the repository at this point in the history
Fixes #44
  • Loading branch information
Krzmbrzl committed Jan 10, 2025
1 parent 361756f commit 0056e12
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions .github/workflows/build_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,49 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Build
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
if: ${{ inputs.publish }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container registry
if: ${{ inputs.publish }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Configure target tags (with latest)
if: ${{ inputs.update_latest }}
run: echo "TAGS=mumblevoip/mumble-server:latest, mumblevoip/mumble-server:${{ inputs.mumble_version }}, mumblevoip/mumble-server:${{ inputs.mumble_version }}-${{ inputs.docker_version }}" >> $GITHUB_ENV
run: echo "PRE_TAGS=mumble-server:latest mumble-server:${{ inputs.mumble_version }} mumble-server:${{ inputs.mumble_version }}-${{ inputs.docker_version }}" >> $GITHUB_ENV

- name: Configure target tags (without latest)
if: ${{ ! inputs.update_latest }}
run: echo "TAGS=mumblevoip/mumble-server:${{ inputs.mumble_version }}, mumblevoip/mumble-server:${{ inputs.mumble_version }}-${{ inputs.docker_version }}" >> $GITHUB_ENV
run: echo "PRE_TAGS=mumble-server:${{ inputs.mumble_version }} mumble-server:${{ inputs.mumble_version }}-${{ inputs.docker_version }}" >> $GITHUB_ENV

- name: Make tags for registries
run: |
TAG_ARRAY=()
for current in $PRE_TAGS; do
TAG_ARRAY+=("mumblevoip/$current" "ghcr.io/mumble-voip/$current")
done
TAGS="$( IFS=","; echo "${TAG_ARRAY[*]}" )"
echo "TAGS=$TAGS" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
platforms: ${{ inputs.platforms }}
Expand Down

0 comments on commit 0056e12

Please sign in to comment.