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 3d415b0
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/collect-instance-uptime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Define data directory
id: define-data-directory
run: |
echo "value=data" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
ref: instance-uptime-data
path: ${{ steps.define-data-directory.outputs.value }}

- 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 +32,8 @@ 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_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 @@ -146,3 +157,13 @@ jobs:
echo "--------"
env:
PREFIX: ${{ vars.INSTANCE_NAME_PREFIX }}
JSON_DIR: ${{ steps.define-data-directory.outputs.value }}

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

0 comments on commit 3d415b0

Please sign in to comment.