chore: add data package #5
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 | |
#---------------------------------------------------------------------------------------------------- | |
# 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 quickbuilds, deploy to DEV, builds and publishes packages to artifact repository | |
name: "CI Pipeline - Auto Triggered" | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
#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: | |
quickbuild: | |
name: "Quickbuild packages" | |
runs-on: ubuntu-latest | |
container: ghcr.io/dxatscale/sfpowerscripts | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: "Authenticate Dev Hub" | |
run: | | |
echo "${{ secrets.DEVHUB_SFDX_AUTH_URL }}" > ./authfile | |
sf org login sfdx-url -f authfile -a devhub | |
- name: "Create packages" | |
id: sfpowerscripts-build | |
run: | | |
sfp orchestrator:quickbuild -v devhub --diffcheck --buildnumber ${GITHUB_RUN_ID} --branch ${GITHUB_REF#refs/heads/} | |
# Publish artifacts | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: quickbuild-artifacts | |
path: artifacts | |
deploy: | |
name: "Deploy to Dev" | |
runs-on: ubuntu-latest | |
container: ghcr.io/dxatscale/sfpowerscripts | |
needs: quickbuild | |
if: github.ref == 'refs/heads/main' | |
environment: | |
name: DEV | |
concurrency: dev | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: quickbuild-artifacts | |
path: artifacts | |
- name: "Authenticate Dev Hub" | |
run: | | |
echo "${{ secrets.DEVHUB_SFDX_AUTH_URL }}" > ./authfile | |
sf org login sfdx-url -f authfile -a devhub | |
- name: Authenticate to DEV sandbox | |
run: | | |
echo "${{ secrets.DEV_SFDX_AUTH_URL }}" > ./dev_authfile | |
sf org login sfdx-url -f ./dev_authfile -a dev | |
- name: "Deploy to DEV" | |
run: | | |
# TODO: To be fixed in dxatscale, for the moment source packages cannot have dependencies to other source packages | |
# sfp dependency:install -u dev -v devhub | |
sfp orchestrator:deploy -u dev --skipifalreadyinstalled -g "::group::,::endgroup::" | |
buildAndPublish: | |
name: "Build and Publish" | |
runs-on: ubuntu-latest | |
container: ghcr.io/dxatscale/sfpowerscripts | |
needs: deploy | |
concurrency: build | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: "Authenticate Dev Hub" | |
run: | | |
echo "${{ secrets.DEVHUB_SFDX_AUTH_URL }}" > ./authfile | |
sf org login sfdx-url -f authfile -a devhub | |
- name: "Create packages" | |
id: sfpowerscripts-build | |
run: | | |
# TODO: quickbuild used instead of build, to be fixed in dxatscale, for the moment source packages cannot have dependencies to other source packages | |
sfp orchestrator:quickbuild -v devhub --diffcheck --branch ${GITHUB_REF#refs/heads/} --buildnumber ${GITHUB_RUN_ID} | |
# Publish artifacts | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: build-artifacts | |
path: artifacts | |
# Authenticate to npm | |
- uses: actions/setup-node@v3 | |
with: | |
registry-url: "https://npm.pkg.github.com" | |
- name: Publish | |
run: | | |
sfp orchestrator:publish -d artifacts --npm --scope @${{ github.repository_owner }} --gittag --pushgittag | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |