-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add schedule action to update website
- Loading branch information
Showing
3 changed files
with
101 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Deploy Website scheduled | ||
|
||
on: | ||
schedule: | ||
# At 10:00 on Monday. | ||
- cron: '0 10 * * 1' | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
|
||
# Build and upload the GitHub Pages artifact. | ||
build: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- recent-redbox-release | ||
- static-files | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '3.3' | ||
# runs 'bundle install' and caches installed gems automatically | ||
bundler-cache: true | ||
# Increment this number if you need to re-download cached gems | ||
cache-version: 0 | ||
|
||
- name: Setup Pages | ||
uses: actions/[email protected] | ||
|
||
# Generate an include file showing details for | ||
# the latest ReDBox release. | ||
- name: Create latest ReDBox release details if not cached | ||
run: .support/generate_latest_release_info.sh | ||
|
||
# Update the static website files | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
cache: 'npm' | ||
|
||
- name: Update the static files | ||
run: .support/update_static_files.sh | ||
|
||
- name: Build with Jekyll | ||
# Outputs to the './_site' directory by default | ||
run: bundle exec jekyll build | ||
env: | ||
JEKYLL_ENV: production | ||
|
||
- name: Upload artifact | ||
uses: actions/[email protected] | ||
|
||
# Deployment job | ||
deploy: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/[email protected] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,35 +24,39 @@ concurrency: | |
cancel-in-progress: false | ||
|
||
jobs: | ||
# Generate an include file showing details for | ||
# the latest ReDBox release. | ||
recent-redbox-release: | ||
|
||
# Build and upload the GitHub Pages artifact. | ||
build: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- recent-redbox-release | ||
- static-files | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Cache ReDBox latest release files | ||
id: cache-redbox-latest-release-file | ||
# Generate an include file showing details for | ||
# the latest ReDBox release. | ||
- name: Cache modified files | ||
id: cache-modified-files | ||
uses: actions/[email protected] | ||
env: | ||
cache-name: cache-redbox-latest-release-file | ||
cache-name: cache-modified-files | ||
with: | ||
path: | | ||
.support/rblatest.json | ||
_includes/latest_release.html | ||
key: cache-redbox-latest-release-file | ||
static/js/bootstrap.bundle.min.js | ||
static/css/bootstrap.min.css | ||
static/css/bootstrap-icons.min.css | ||
static/css/fonts/bootstrap-icons.woff | ||
static/css/fonts/bootstrap-icons.woff2 | ||
key: cache-modified-files | ||
|
||
- if: ${{ steps.cache-redbox-latest-release-file.outputs.cache-hit != 'true' }} | ||
name: Create latest ReDBox release details if not cached | ||
run: .support/generate_latest_release_info.sh | ||
|
||
static-files: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
|
@@ -61,16 +65,6 @@ jobs: | |
- name: Update the static files | ||
run: .support/update_static_files.sh | ||
|
||
# Build and upload the GitHub Pages artifact. | ||
build: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- recent-redbox-release | ||
- static-files | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
|
@@ -85,11 +79,12 @@ jobs: | |
|
||
- name: Build with Jekyll | ||
# Outputs to the './_site' directory by default | ||
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" | ||
run: bundle exec jekyll build | ||
env: | ||
JEKYLL_ENV: production | ||
|
||
- name: Upload artifact | ||
if: ${{ ! startsWith(github.ref, 'refs/heads/dependabot') }} | ||
uses: actions/[email protected] | ||
|
||
# Deployment job | ||
|
@@ -99,6 +94,7 @@ jobs: | |
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
needs: build | ||
if: ${{ ! startsWith(github.ref, 'refs/heads/dependabot') }} | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
|
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