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
-
Your GitHub repository name must follow this pattern:
Telefonica/living-app-v2-<la-name>
.E.g:
living-app-v2-secret-wars
-
Request to the LA Platform Team to register the repository at the self hosted runner pool.
-
Create the workflow files (already created if you forked the template)
- 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- 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 - pull request:
Available workflows
Living Apps CI provide the following workflows:
Pull Request
Executed on pull requests:
Step | Requirement | Description |
---|---|---|
check-title | Optional | Check if the PR title follows our semantic release pattern. |
build | Required | Build the app. |
unit-tests | Optional | Run unit tests (npm run test:unit ) |
integration-tests | Optional | Run 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
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
:
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' }}