update harmony to latest and main branch #68
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 pipeline | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
set-version: | |
name: Set Version | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.setVersion.outputs.VERSION }} | |
steps: | |
- name: Set Version | |
id: setVersion | |
# set version to date in vYYYY-MM-DD-commitSha format | |
run: | | |
shortSha=$(echo ${{ github.sha }} | cut -c1-8) | |
echo "VERSION=v$(date --rfc-3339=date)-$shortSha" >> ${GITHUB_OUTPUT} | |
build-api: | |
name: Build API | |
needs: [ set-version ] | |
uses: ./.github/workflows/lexbox-api.yaml | |
with: | |
version: ${{ needs.set-version.outputs.version }} | |
label-latest: true | |
build-ui: | |
name: Build UI | |
needs: [ set-version ] | |
uses: ./.github/workflows/lexbox-ui.yaml | |
with: | |
version: ${{ needs.set-version.outputs.version }} | |
label-latest: true | |
build-hgweb: | |
name: Build hgweb | |
needs: [ set-version ] | |
uses: ./.github/workflows/lexbox-hgweb.yaml | |
with: | |
version: ${{ needs.set-version.outputs.version }} | |
label-latest: true | |
deploy: | |
name: Deploy Staging | |
uses: ./.github/workflows/deploy.yaml | |
needs: [ build-api, build-ui, build-hgweb, set-version ] | |
secrets: inherit | |
with: | |
version: ${{ needs.set-version.outputs.version }} | |
image: 'ghcr.io/sillsdev/lexbox-*' | |
k8s-environment: staging | |
deploy-domain: staging.languagedepot.org | |
integration-tests: | |
name: Integration tests | |
uses: ./.github/workflows/integration-test.yaml | |
strategy: | |
fail-fast: false | |
matrix: | |
runs-on: | |
- ubuntu-latest | |
- windows-latest | |
hg-version: | |
- '3' | |
- '6' | |
include: | |
- run-playwright: false | |
- runs-on: ubuntu-latest | |
hg-version: '6' | |
run-playwright: true | |
needs: deploy | |
permissions: | |
checks: write | |
secrets: inherit | |
with: | |
environment: staging | |
runs-on: ${{ matrix.runs-on }} | |
hg-version: ${{ matrix.hg-version }} | |
run-playwright: ${{ matrix.run-playwright }} | |
deploy-prod: | |
name: Deploy Production | |
uses: ./.github/workflows/deploy.yaml | |
needs: [ integration-tests, set-version ] | |
# we want to allow deployment even if some tests fail because they are currently flaky | |
if: ${{ !cancelled() && (needs.integration-tests.result == 'success' || needs.integration-tests.result == 'failure') }} | |
secrets: inherit | |
with: | |
version: ${{ needs.set-version.outputs.version }} | |
image: 'ghcr.io/sillsdev/lexbox-*' | |
k8s-environment: production | |
deploy-domain: languagedepot.org | |
generate-release: | |
name: Generate Release | |
needs: [ deploy-prod, set-version ] | |
# we want to generate a release when deployment succeeds, by default this would be cancelled if integration tests failed | |
if: ${{ !cancelled() && needs.deploy-prod.result == 'success' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Release | |
uses: softprops/action-gh-release@a6c7483a42ee9d5daced968f6c217562cd680f7f # v2.0.0 | |
with: | |
tag_name: ${{ needs.set-version.outputs.version }} | |
target_commitish: ${{ github.sha }} | |
generate_release_notes: true |