Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish snapshots on a schedule, make params bools #1093

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@ on:
publishSnapshot:
description: "Publish Snapshot"
required: false
default: "false"
default: false
type: boolean
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it a checkbox.

publishMicrosite:
description: "Publish Microsite"
required: false
default: "false"
default: false
type: boolean
push:
branches: ["main", "series/**", "feature/**"]
tags: ["v*"]
pull_request:
branches: ["**"]
schedule:
# midnight, every Monday and Thursday
- cron: '0 0 * * 1,4'

concurrency:
group: ci-${{ github.ref }}
Expand Down Expand Up @@ -99,7 +104,10 @@ jobs:
release:
name: Release
needs: build
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.publishSnapshot == 'true') # || (github.ref == 'refs/heads/main')
if:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

startsWith(github.ref, 'refs/tags/v') ||
github.event.inputs.publishSnapshot ||
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: I removed the event_name == workflow_dispatch check, as I think it's redundant - at the moment, inputs can only be set by running a manual dispatch. In other jobs, the input defaults to false.

github.event_name == 'schedule'
runs-on: ubuntu-latest
steps:
- name: Checkout current branch (full)
Expand Down Expand Up @@ -135,7 +143,9 @@ jobs:

microsite:
name: Publish Docs Microsite
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.publishMicrosite == 'true')
if:
startsWith(github.ref, 'refs/tags/v') ||
github.event.inputs.publishMicrosite
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above, removed the event_name check out of redundancy.

I didn't make the microsite get published on the schedule as schedules only run on the default branch, meaning we couldn't publish the site from series/0.17 that way.

runs-on: ubuntu-latest
steps:
- name: Checkout current branch (full)
Expand Down