Skip to main content

CI/CD

We provide a set of unified Continuous Integration & Continuous Delivery workflows for Living Apps projects in Telefonica's GitHub organization, powered by GitHub Actions.

Requirements

  1. Your GitHub repository name must follow this pattern: Telefonica/living-app-v2-<la-name>.

    E.g: living-app-v2-secret-wars

  2. Request to the LA Platform Team to register the repository at the self hosted runner pool.

  3. Create the workflow files (already created if you forked the template)

    1. pull request: .github/workflows/pull-request.yaml
    name: pull request
    on: [pull_request]

    jobs:
    la-pr:
    uses: telefonica/living-apps-gh-actions/.github/workflows/pull-request.yaml@master
    1. release: .github/workflows/release.yaml
    name: release
    on:
    push:
    branches: [master]

    workflow_dispatch: {}

    jobs:
    la-release:
    uses: telefonica/living-apps-gh-actions/.github/workflows/release.yaml@master

Available workflows

Living Apps CI provide the following workflows:

Pull Request Pull Request

Executed on pull requests:

StepRequirementDescription
check-titleOptionalCheck if the PR title follows our semantic release pattern.
buildRequiredBuild the app.
unit-testsOptionalRun unit tests (npm run test:unit)
integration-testsOptionalRun integration tests (npm run test:integration)

check-title: (enabled by default) will check if the PR title follows the pattern feat|fix|chore|docs|refactor: <description>.

Examples: "feat: add new feature", "fix(ui): fix a bug", "chore(ci): include CI", "chore: review package scripts".

build: (REQUIRED) will run the following commands:

npm ci --ignore-scripts
npm run lint --if-present
npm run prettier --if-present
npm run build

unit-tests: (enabled by default) will run the command npm run test:unit from the package.json scripts.

integration-tests: (disabled by default) will run the command npm run test:integration from the package.json scripts.

Full Example:

name: pull request
on: [pull_request]

jobs:
la-pr:
uses: telefonica/living-apps-gh-actions/.github/workflows/pull-request.yaml@master
with:
check-title: true
unit-tests: true
integration-tests: false

Release Release

Executed on push to master or release/* branches.

Publish the build/* folder to az storage.

Details:

  • Azure storage account: globalmakermedia
  • Azure container name: living-apps
  • path: determined by release branch name and living app name;

Example, if the living app is named living-app-v2-secret-wars:

release branchfinal URL
masterhttps://globalmakermedia.blob.core.windows.net/living-apps/latest/la-secret-wars/web/index.html
release/4.42.0-thorhttps://globalmakermedia.blob.core.windows.net/living-apps/4.42.0-thor/la-secret-wars/web/index.html

The uploaded build folder will include an additional file named _v.json, which contains the exact commit and timestamp. This file is served at: https://globalmakermedia.blob.core.windows.net/living-apps/latest/la-{NAME}/web/_v.json

Full Example:

name: release
on:
push:
branches: [master]

workflow_dispatch:
inputs:
dry-run:
description: '--dry-run'
required: false
type: boolean
default: false

jobs:
la-release:
uses: telefonica/living-apps-gh-actions/.github/workflows/release.yaml@master
with:
dry-run: ${{ github.event.inputs.dry-run == 'true' }}