Skip to content

Implement auto update in Fieldworks Lite #167

Implement auto update in Fieldworks Lite

Implement auto update in Fieldworks Lite #167

name: Develop FwHeadless CI/CD
on:
workflow_dispatch:
push:
paths:
- 'backend/FwHeadless/**'
- 'backend/FixFwData/**'
- 'backend/FwLite/FwDataMiniLcmBridge/**'
- 'backend/FwLite/LcmCrdt/**'
- 'backend/FwLite/MiniLcm/**'
- 'backend/FwLiteProjectSync/FwLiteProjectSync/**'
- 'backend/LexCore/**'
- 'backend/LexData/**'
- '.github/workflows/lexbox-fw-headless.yaml'
- '.github/workflows/deploy.yaml'
- 'deployment/base/fw-headless-deployment.yaml'
branches:
- develop
pull_request:
paths:
- 'backend/FwHeadless/**'
- 'backend/FixFwData/**'
- 'backend/FwLite/FwDataMiniLcmBridge/**'
- 'backend/FwLite/LcmCrdt/**'
- 'backend/FwLite/MiniLcm/**'
- 'backend/FwLiteProjectSync/FwLiteProjectSync/**'
- 'backend/LexCore/**'
- 'backend/LexData/**'
- '.github/workflows/lexbox-fw-headless.yaml'
- '.github/workflows/deploy.yaml'
- 'deployment/base/fw-headless-deployment.yaml'
branches:
- develop
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-fw-headless:
name: Build FwHeadless
needs: set-version
uses: ./.github/workflows/lexbox-fw-headless.yaml
with:
version: ${{ needs.set-version.outputs.version }}
deploy-fw-headless:
name: Deploy FwHeadless
if: ${{github.ref == 'refs/heads/develop'}}
needs: [ build-fw-headless, set-version ]
uses: ./.github/workflows/deploy.yaml
secrets: inherit
with:
version: ${{ needs.set-version.outputs.version }}
image: 'ghcr.io/sillsdev/lexbox-fw-headless'
k8s-environment: develop
deploy-domain: lexbox.dev.languagetechnology.org
# TODO: Run FwHeadless tests once we have developed them, but we don't need to run the whole integration test suite if only FwHeadless changes are being pushed
# integration-test-gha:
# name: GHA integration tests
# needs: [build-fw-headless, set-version]
# uses: ./.github/workflows/integration-test-gha.yaml
# with:
# lexbox-fw-headless-tag: ${{ needs.set-version.outputs.version }}