Release - User Triggered #1
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
# DX@Scale CI/CD Template for GitHub | |
#---------------------------------------------------------------------------------------------------- | |
# Maintained by @aly76 for DX@Scale | |
# Follows reference pipeline available at docs.dxatscale.io | |
# | |
#----------------------------------------------------------------------------------------------------- | |
# To know more about dxatscale, visit https://docs.dxatscale.io | |
# To know more on sfpowerscripts, visit- https://docs.dxatscale.io/sfpowerscripts/sfpowerscripts | |
# This pipeline is used to release a set of packages into respective environments | |
# Changelog will be written to changelog branch | |
name: 'CD Pipeline - 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 }}' | |
jobs: | |
ST: | |
runs-on: ubuntu-latest | |
container: ghcr.io/dxatscale/sfpowerscripts | |
environment: | |
name: ST | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Authenticate to ST sandbox | |
run: | | |
echo "${{ secrets.ST_SFDX_AUTH_URL }}" > ./authfile | |
sf org login sfdx-url -f ./authfile -a st | |
# Authenticate to npm | |
- uses: actions/setup-node@v3 | |
with: | |
registry-url: 'https://npm.pkg.github.com' | |
# Release to environment | |
- name: 'Release to ST' | |
run: 'sfp orchestrator:release -u st -p ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::"' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SIT: | |
runs-on: ubuntu-latest | |
container: ghcr.io/dxatscale/sfpowerscripts | |
if: github.ref == 'refs/heads/main' || contains(github.ref,'refs/heads/release') | |
environment: | |
name: SIT | |
needs: ST | |
steps: | |
- uses: actions/checkout@v2 | |
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' | |
# Release to environment | |
- name: 'Release to SIT' | |
run: 'sfp orchestrator:release -u sit -p ${{ 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/dxatscale/sfpowerscripts | |
if: contains(github.ref,'refs/heads/release') | |
environment: | |
name: UAT | |
steps: | |
- uses: actions/checkout@v2 | |
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' | |
# Release to environment | |
- name: 'Release to UAT' | |
run: 'sfp orchestrator:release -u uat -p ${{ 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/dxatscale/sfpowerscripts | |
if: contains(github.ref,'refs/heads/release') | |
environment: | |
name: PROD | |
needs: UAT | |
steps: | |
- uses: actions/checkout@v2 | |
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' | |
# Release to environment | |
- name: 'Release to PROD' | |
run: 'sfp orchestrator:release -u prod -p ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::"' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |