Release - User Triggered #4
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
# Flxbl CI/CD Template for GitHub | |
#---------------------------------------------------------------------------------------------------- | |
# Follows reference pipeline available at docs.dxatscale.io | |
# | |
#----------------------------------------------------------------------------------------------------- | |
# To know more about Flxbl, visit https://docs.dxatscale.io | |
# To know more on sfp, visit https://docs.flxbl.io/sfp | |
# This pipeline is used to release a set of packages into respective environments. | |
# Changelog will be written to changelog branch. | |
name: Release - User Triggered | |
on: | |
workflow_dispatch: | |
inputs: | |
pathToReleaseDef: | |
description: "Path to release definition file" | |
required: true | |
# Set the environment variables for tracking metrics | |
#env: | |
# SFPOWERSCRIPTS_NEWRELIC: 'true' | |
# SFPOWERSCRIPTS_NEWRELIC_API_KEY: '${{ secrets.NEWRELIC_INSIGHT_INSERT_KEYS }}' | |
# SFPOWERSCRIPTS_DATADOG: 'true' | |
# SFPOWERSCRIPTS_DATADOG_HOST: '${{ secrets.DATADOG_HOST }}' | |
# SFPOWERSCRIPTS_DATADOG_API_KEY: '${{ secrets.DATADOG_API_KEY }}' | |
# SFPOWERSCRIPTS_SPLUNK: 'true' | |
# SFPOWERSCRIPTS_SPLUNK_HOST: '${{ secrets.SPLUNK_HOST }}' | |
# SFPOWERSCRIPTS_SPLUNK_API_KEY: '${{ secrets.SPLUNK_API_KEY }}' | |
jobs: | |
SIT: | |
runs-on: ubuntu-latest | |
container: ghcr.io/flxbl-io/sfp | |
if: github.ref == 'refs/heads/main' || contains(github.ref,'refs/heads/release') | |
environment: | |
name: SIT | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Authenticate to SIT sandbox | |
run: | | |
echo "${{ secrets.SIT_SFDX_AUTH_URL }}" > ./authfile | |
sf org login sfdx-url -f ./authfile -a sit | |
# Authenticate to npm | |
- uses: actions/setup-node@v3 | |
with: | |
registry-url: "https://npm.pkg.github.com" | |
- name: Release to SIT | |
run: 'sfp release --targetorg sit --releasedefinition ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::" ' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
UAT: | |
runs-on: ubuntu-latest | |
container: ghcr.io/flxbl-io/sfp | |
if: contains(github.ref,'refs/heads/release') | |
environment: | |
name: UAT | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Authenticate to UAT | |
run: | | |
echo "${{ secrets.UAT_SFDX_AUTH_URL }}" > ./authfile | |
sf org login sfdx-url -f ./authfile -a uat | |
# Authenticate to npm | |
- uses: actions/setup-node@v3 | |
with: | |
registry-url: "https://npm.pkg.github.com" | |
- name: Release to UAT | |
run: 'sfp release --targetorg uat --releasedefinition ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::"' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PROD: | |
runs-on: ubuntu-latest | |
container: ghcr.io/flxbl-io/sfp | |
if: contains(github.ref,'refs/heads/release') | |
environment: | |
name: PROD | |
needs: UAT | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Authenticate to PROD | |
run: | | |
echo "${{ secrets.DEVHUB_SFDX_AUTH_URL }}" > ./authfile | |
sf org login sfdx-url -f ./authfile -a prod | |
# Authenticate to npm | |
- uses: actions/setup-node@v3 | |
with: | |
registry-url: "https://npm.pkg.github.com" | |
- name: Release to PROD | |
run: 'sfp release --targetorg prod --releasedefinition ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::"' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |