Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ on:
release:
types:
- published
repository_dispatch:
types: [update-docs]

jobs:
lint:
runs-on: ubuntu-20.04
timeout-minutes: 60
if: ${{ ((github.event_name != 'repository_dispatch') && (github.event.action != 'update-docs')) }}
steps:
- name: Checkout current branch
uses: actions/[email protected]
Expand All @@ -37,6 +40,7 @@ jobs:
compile:
runs-on: ubuntu-20.04
timeout-minutes: 120
if: ${{ ((github.event_name != 'repository_dispatch') && (github.event.action != 'update-docs')) }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -71,6 +75,7 @@ jobs:
publishLocal:
runs-on: ubuntu-20.04
timeout-minutes: 60
if: ${{ ((github.event_name != 'repository_dispatch') && (github.event.action != 'update-docs')) }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -100,6 +105,7 @@ jobs:

build-website:
runs-on: ubuntu-20.04
if: ${{ ((github.event_name != 'repository_dispatch') && (github.event.action != 'update-docs')) }}
steps:
- name: Checkout series/2.x Branch
uses: actions/checkout@v3
Expand Down Expand Up @@ -162,6 +168,7 @@ jobs:
test:
runs-on: ubuntu-20.04
timeout-minutes: 60
if: ${{ ((github.event_name != 'repository_dispatch') && (github.event.action != 'update-docs')) }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -225,6 +232,7 @@ jobs:
testJvms:
runs-on: ubuntu-20.04
timeout-minutes: 60
if: ${{ ((github.event_name != 'repository_dispatch') && (github.event.action != 'update-docs')) }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -260,6 +268,7 @@ jobs:
testPlatforms:
runs-on: ubuntu-20.04
timeout-minutes: 60
if: ${{ ((github.event_name != 'repository_dispatch') && (github.event.action != 'update-docs')) }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -338,3 +347,37 @@ jobs:
with:
branch: gh-pages
folder: ./website-artifact

update-docs:
runs-on: ubuntu-latest
if: ${{ ((github.event_name == 'repository_dispatch') && (github.event.action == 'update-docs')) }}
steps:
- name: Git Checkout
uses: actions/[email protected]
with:
ref: ${{ github.head_ref }}
fetch-depth: '0'
- name: Commit Changes
run: |
cd website
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
package_name="${{ github.event.client_payload.package_name }}"
package_version="${{ github.event.client_payload.package_version }}"
yarn add "$package_name@$package_version"
git add package.json
commit_message="Update $package_name to $package_version"
git commit -m "$commit_message" || echo "No changes to commit"

- name: Create Pull Request to Update Docs
uses: peter-evans/[email protected]
with:
body: |-
The new version of ${{ github.event.client_payload.package_name }} was released.
Let's update the zio.dev to reflect the latest docs.
branch: zio-sbt/update-docs/${{ github.event.client_payload.package_name }}
commit-message: Update ${{ github.event.client_payload.package_name }} docs
to ${{ github.event.client_payload.package_version }}
delete-branch: true
title: Update ${{ github.event.client_payload.package_name }} docs
to ${{ github.event.client_payload.package_version }}