This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
Bump node-fetch and next #74
Workflow file for this run
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
name: Build and Publish Radar | |
on: | |
pull_request: | |
branches: | |
- 'main' | |
push: | |
branches: | |
- 'main' | |
env: | |
RADAR_BRANCH: "radar" | |
RADAR_FILENAME: "Sitecore Radar.csv" | |
SHOULD_PUBLISH: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Node.js environment | |
uses: actions/[email protected] | |
with: | |
node-version: 14.17.6 | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Build and Export dockz | |
run: | | |
npm run build | |
- name: Generate Radar | |
run: | | |
node transform.js | |
ls -al | |
mkdir -p ./out/radar/latest | |
mv radar.csv "./out/radar/latest/${{ env.RADAR_FILENAME }}" | |
- name: Create radar branch dir | |
if: ${{ env.SHOULD_PUBLISH == 'true' }} | |
run: | | |
ls -al | |
mkdir ../radarbranch | |
cp -R ./out/* ../radarbranch/ | |
cd ../radarbranch | |
ls -al | |
- name: Checkout Radar Branch | |
uses: actions/checkout@v2 | |
if: ${{ env.SHOULD_PUBLISH == 'true' }} | |
with: | |
ref: ${{ env.RADAR_BRANCH }} | |
- name: Prepair Git Config | |
if: ${{ env.SHOULD_PUBLISH == 'true' }} | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
- name: Commit Radar | |
if: ${{ env.SHOULD_PUBLISH == 'true' }} | |
run: | | |
cp -R ../radarbranch/* ./ | |
git add . | |
git commit -m 'Radar Updated by GH Action' -a | |
- name: Push Radar | |
if: ${{ env.SHOULD_PUBLISH == 'true' }} | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ env.RADAR_BRANCH }} |