67 lines
2.1 KiB
YAML
67 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: ${{ startsWith(github.ref, 'refs/heads/testing') }} # deployments on testing* will cancel each other, prod and tags no
|
|
|
|
jobs:
|
|
get-version:
|
|
name: Get version
|
|
uses: ./.github/workflows/get-version.yml
|
|
|
|
tests:
|
|
needs: [get-version]
|
|
uses: ./.github/workflows/tests.yml
|
|
with:
|
|
IMAGE_VERSION_TAG: ${{ needs.get-version.outputs.IMAGE_VERSION_TAG }}
|
|
DOCKERHUB_USERNAME: 'speckledevops'
|
|
CONTINUE_ON_ERROR: ${{ startsWith(github.ref, 'refs/heads/testing') }} # allows releasing on testing even if test fail
|
|
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'
|
|
IMAGE_PREFIX: 'speckle' # without an explicit host, Docker defaults to pushing Docker Hub
|
|
PUBLISH: true # publish the sourcemaps and include the version in frontend-2 builds
|
|
PUBLISH_LATEST: ${{ startsWith(github.ref, 'refs/heads/main') }}
|
|
secrets: inherit
|
|
|
|
test-deployments:
|
|
needs: [get-version, builds]
|
|
uses: ./.github/workflows/deployment-tests.yml
|
|
with:
|
|
IMAGE_VERSION_TAG: ${{ needs.get-version.outputs.IMAGE_VERSION_TAG }}
|
|
DOCKERHUB_USERNAME: 'speckledevops'
|
|
IMAGE_PREFIX: 'speckle'
|
|
secrets: inherit
|
|
|
|
deploy:
|
|
needs: [get-version, tests, builds, test-deployments]
|
|
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
|