hopefully final fix #34
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
## workflow will trigger on below condition, | |
## except image release that have jobs condition to trigger only on tagging | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- 'relay/nakama/v*.*.*' | |
defaults: | |
run: | |
shell: bash | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME_PREFIX: ${{ github.repository }} | |
jobs: | |
build-nakama: | |
name: Docker Image (Nakama) | |
if: startsWith(github.ref, 'refs/tags/relay/nakama/v') | |
runs-on: namespace-profile-linux-8vcpu-16gb-cached | |
# Add "id-token" with the intended permissions. | |
permissions: | |
contents: read | |
id-token: write | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install and configure Namespace CLI | |
uses: namespacelabs/nscloud-setup@v0 | |
- name: Configure Namespace powered Buildx | |
uses: namespacelabs/nscloud-setup-buildx-action@v0 | |
- name: Docker - Auth to Github Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract semver from tag | |
id: semver | |
run: | | |
echo "tag=$(echo ${GITHUB_REF#refs/tags/relay/nakama/})" >> $GITHUB_OUTPUT | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}-nakama | |
tags: | | |
type=semver,pattern={{version}},value=${{ steps.semver.outputs.tag }} | |
type=semver,pattern={{major}}.{{minor}},value=${{ steps.semver.outputs.tag }} | |
type=sha | |
- name: Prepare arm64 tags | |
id: arm64_tags | |
run: | | |
TAGS="${{ steps.meta.outputs.tags }}" | |
TAGS_ARM64="$(echo "$TAGS" | grep -v 'sha-' | sed 's/$/-arm64/g')" | |
echo "tags<<EOF" >> $GITHUB_OUTPUT | |
echo "$TAGS_ARM64" >> $GITHUB_OUTPUT | |
echo "EOF" >> $GITHUB_OUTPUT | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./relay/nakama/Dockerfile | |
target: nakama | |
platforms: linux/amd64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Build and push (linux/arm64) | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./relay/nakama/Dockerfile | |
target: nakama-arm | |
platforms: linux/arm64 | |
push: true | |
tags: ${{ steps.arm64_tags.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }}-arm64 |