Skip to content

Commit

Permalink
feat(collect-instance-uptime): Publish "instance-uptime-data" branch
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfr committed Aug 27, 2024
1 parent 725ca3b commit 66b8fba
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/collect-instance-uptime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
- uses: actions/checkout@v4

- name: Collect Instance Uptime
id: collect-instance-uptime
run: |
export OS_CLOUD=BIO180006_IU # Select openstack auth settings defined in ".config/openstack/clouds.yaml"
Expand All @@ -21,8 +22,10 @@ jobs:
instance_basename="${instance_prefix}instance"
# Define the JSON file paths for storing/updating uptimes
JSON_FILE=uptime.json
JSON_FILE_TMP=uptime.json.tmp
JSON_DIR=data
mkdir -p $JSON_DIR
JSON_FILE=$JSON_DIR/uptime.json
JSON_FILE_TMP=$(mktemp $RUNNER_TEMP/uptime.XXXXXX.json)
# Initialize the JSON file if it doesn't exist, with a basic structure
if [[ ! -f $JSON_FILE ]]; then
Expand Down Expand Up @@ -144,5 +147,16 @@ jobs:
echo "--------"
cat $JSON_FILE
echo "--------"
echo "json_dir=$JSON_DIR" >> $GITHUB_OUTPUT
env:
PREFIX: ${{ vars.INSTANCE_NAME_PREFIX }}

- name: Publish
uses: s0/git-publish-subdir-action@5bc6742efb946f4cba68c7a9067a31ea5631071d # develop
env:
REPO: self
BRANCH: instance-uptime-data
FOLDER: ${{ steps.collect-instance-uptime.outputs.json_dir }}
SQUASH_HISTORY: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 66b8fba

Please sign in to comment.