Skip to content

Commit

Permalink
added nightly release gha with version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
jblom committed Apr 5, 2024
1 parent bd927e4 commit 266aad4
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 16 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/_release-with-built-site-as-artifact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release tag with _site.tar.gz artefact
on:
workflow_call:
inputs:
tag:
description: Github Tag to create
required: true
type: string

jobs:
bundle:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 #v4.1.2
- uses: ruby/setup-ruby@v1 # https://github.com/ruby/setup-ruby?tab=readme-ov-file#versioning
with:
ruby-version: "3.3" # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: gem install jekyll bundler
- run: bundle exec jekyll build
- run: tar -cvvzf _site.tar.gz ./_site
- name: Create release
run: gh release create ${{ inputs.tag }} _site.tar.gz
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 5 additions & 16 deletions .github/workflows/manual-release-with-built-site-as-artifact.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Manual release from tag
name: Manual release custom tag
on:
workflow_dispatch:
inputs:
Expand All @@ -8,18 +8,7 @@ on:
type: string

jobs:
bundle:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 #v4.1.2
- uses: ruby/setup-ruby@v1 # https://github.com/ruby/setup-ruby?tab=readme-ov-file#versioning
with:
ruby-version: '3.3' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: gem install jekyll bundler
- run: bundle exec jekyll build
- run: tar -cvvzf _site.tar.gz ./_site
- name: Create release
run: gh release create ${{ inputs.tag }} _site.tar.gz
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
uses: ./.github/workflows/_release-with-built-site-as-artifact.yml
with:
tag: ${{inputs.tag}}
22 changes: 22 additions & 0 deletions .github/workflows/nighly-build-release-with-artefact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Nighly release of main branch with bumped tag

on:
schedule:
- cron: "0 1 * * *"

jobs:
bump-version:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.bumped-tag.outputs.tag }}
steps:
- id: bumped-tag
run: |
VERSION=`git describe --tags --abbrev=0 | awk -F. '{OFS="."; $NF+=1; print $0}'`; \
echo "tag=${VERSION}" >> $GITHUB_OUTPUT
release:
uses: ./.github/workflows/_release-with-built-site-as-artifact.yml
needs: bump-version
with:
tag: ${{needs.bump-version.outputs.tag}}

0 comments on commit 266aad4

Please sign in to comment.