Files
speckle-server/.github/workflows/release.yml
T

69 lines
2.1 KiB
YAML

name: Release pipeline
on:
push:
branches:
- main
- 'hotfix.*'
- 'testing*'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ contains(github.ref, 'testing*')}} # deployments on testing* will cancel each other, prod and tags no
jobs:
get-version:
outputs:
IMAGE_VERSION_TAG: ${{ steps.export-step.outputs.IMAGE_VERSION_TAG }}
name: Get version
runs-on: blacksmith
steps:
- uses: actions/checkout@v4.2.2
- run: git fetch origin 'refs/tags/*:refs/tags/*'
- run: chmod +x ./get_version.sh ./common.sh
working-directory: ./.github/workflows/scripts
- run: ./get_version.sh >> result
working-directory: ./.github/workflows/scripts
- run: echo "IMAGE_VERSION_TAG=$(cat result)"
working-directory: ./.github/workflows/scripts
- id: export-step
run: echo "IMAGE_VERSION_TAG=$(cat result)" >> "$GITHUB_OUTPUT"
working-directory: ./.github/workflows/scripts
tests:
needs: get-version
uses: ./.github/workflows/tests.yml
with:
IMAGE_VERSION_TAG: ${{ needs.get-version.outputs.IMAGE_VERSION_TAG }}
DOCKERHUB_USERNAME: 'speckledevops'
secrets: inherit
builds:
needs: get-version
uses: ./.github/workflows/builds.yml
with:
IMAGE_VERSION_TAG: ${{ needs.get-version.outputs.IMAGE_VERSION_TAG }}
DOCKERHUB_USERNAME: 'speckledevops'
PUSH_IMAGES: true
secrets: inherit
deploy:
needs: [get-version, tests, builds]
uses: ./.github/workflows/publish.yml
with:
IMAGE_VERSION_TAG: ${{ needs.get-version.outputs.IMAGE_VERSION_TAG }}
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
DOCKERHUB_USERNAME: 'speckledevops'
secrets: inherit
npm:
needs: [get-version, tests, builds]
uses: ./.github/workflows/npm.yml
if: startsWith(github.ref, 'refs/tags/') # a tag triggered the workflow
with:
IMAGE_VERSION_TAG: ${{ needs.get-version.outputs.IMAGE_VERSION_TAG }}
secrets: inherit