Skip to content

Commit

Permalink
Add action to push the raport to gh page branch
Browse files Browse the repository at this point in the history
  • Loading branch information
MaciejG604 committed May 22, 2023
1 parent a54e2c4 commit e34e6f4
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/buildExecuteCustom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,11 @@ jobs:
with:
name: build-raports
path: ${{ github.workspace }}/raport-*.md

- name: Push raport
uses: ./.github/actions/push-raport-to-gh-page
with:
artifact-name: build-raports
file-to-pick: raport-full.md
build-title: ${{ needs.execute-build-plan.outputs.used-scala-version }}
token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}
8 changes: 8 additions & 0 deletions .github/workflows/buildExecuteScheduledWeekly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,11 @@ jobs:
with:
name: build-raports
path: ${{ github.workspace }}/raport-*.md

- name: Push raport
uses: ./.github/actions/push-raport-to-gh-page
with:
artifact-name: build-raports
file-to-pick: raport-full.md
build-title: ${{ needs.execute-build-plan.outputs.used-scala-version }}
token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/compare.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
with:
apps: scala-cli

- run: echo "filename=$(./scripts/get_filename.sh)" >> "$GITHUB_ENV"
id: filename
- name: Generate raport
env:
ES_USER: ${{ secrets.OPENCB_ELASTIC_USER }}
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,11 @@ node_modules
/tmp

# scala-cli
**/.scala-build
**/.scala-build

# jekyll
_site
.sass-cache
.jekyll-cache
.jekyll-metadata
vendor
16 changes: 16 additions & 0 deletions scripts/create_post_with_front_matter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

filename="$1"

if [ -z "$filename" ]; then
echo "Please provide a filename as an argument."
exit 1
fi

echo "---" > "$filename"
echo "layout: post" >> "$filename"
echo "date: $(date "+%Y-%m-%d %H:%M:%S %z")" >> "$filename"
echo "---" >> "$filename"
echo "" >> "$filename"

echo "Content has been written to $filename."
9 changes: 9 additions & 0 deletions scripts/get_filename.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

current_date=$(date "+%Y-%m-%d")

second_of_day=$(date "+%H3600+%M60+%S" | bc)

filename="${current_date}-build-result-${second_of_day}.md"

echo $filename

0 comments on commit e34e6f4

Please sign in to comment.