Skip to content

refactor(main): add a change to the handler signatures so they can re… #33

refactor(main): add a change to the handler signatures so they can re…

refactor(main): add a change to the handler signatures so they can re… #33

Workflow file for this run

name: Deploy Morphos Server Container Image
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # Only build on tag with semantic versioning format
jobs:
push_morphos_image:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# Script for setting the version without the leading 'v'
- name: Set Versions
uses: actions/github-script@v7
id: set_version
with:
script: |
// Get the tag
const tag = context.ref.substring(10)
// Replace the tag with one without v
const no_v = tag.replace('v', '')
// Looks for a dash
const dash_index = no_v.lastIndexOf('-')
// If any, removes it, otherwise return the value unchanged
const no_dash = (dash_index > -1) ? no_v.substring(0, dash_index) : no_v
// Set the tag, no-v and no-dash as output variables
core.setOutput('tag', tag)
core.setOutput('no-v', no_v)
core.setOutput('no-dash', no_dash)
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/${{ github.actor }}/morphos-server:latest, ghcr.io/${{ github.actor }}/morphos-server:${{steps.set_version.outputs.no-dash}}
- name: Release
uses: softprops/action-gh-release@v1