Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Manual - Lavalink

Manual - Lavalink #2

Workflow file for this run

name: Manual - Lavalink
on:
workflow_dispatch:
inputs:
version_tag:
description: Release version to download.
required: true
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
LOWER_REPO: ''
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download Server
run: wget https://github.com/lavalink-devs/Lavalink/releases/download/${{ inputs.version_tag }}/Lavalink.jar
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@main
with:
cosign-release: "v1.13.1"
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Convert repository name to lowercase
id: lowercase-repo
run: |
echo "::set-output name=lowercase_repo::$(echo ${{ env.IMAGE_NAME }} | tr '[:upper:]' '[:lower:]')"
- name: Set lowercase repository name
run: |
echo "LOWER_REPO=${{ steps.lowercase-repo.outputs.lowercase_repo }}" >> $GITHUB_ENV
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.LOWER_REPO }}:${{ inputs.version_tag }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
COSIGN_EXPERIMENTAL: "true"
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}