Skip to content

Prepare new update for Elm Dash docset #117

Prepare new update for Elm Dash docset

Prepare new update for Elm Dash docset #117

name: Prepare new update for Elm Dash docset
on:
workflow_dispatch:
schedule:
- cron: '26 4 4,18 * *' # every 4th and 18th of the month at 4:26am
jobs:
sync_with_upstream:
runs-on: ubuntu-latest
name: Sync master with latest upstream
steps:
- name: Checkout master
uses: actions/checkout@v2
with:
ref: docs
- name: Pull upstream changes
id: sync
uses: aormsby/[email protected]
with:
upstream_repository: 'Kapeli/Dash-User-Contributions'
upstream_branch: 'master'
target_branch: 'docs'
target_repo_token: ${{ secrets.WORKFLOW_TOKEN }}
- name: Timestamp
run: date
build_docs:
name: Build Elm docset
needs: sync_with_upstream
runs-on: ubuntu-latest
container:
image: kraklin/elm-docset:1.1.6
steps:
- name: Generate elm packages docs
run: 'cd /usr/src/app && python generate.py'
- name: Pack it
run: 'cd /usr/src/app && ./pack.sh'
- name: Prepare readme and docset
run: 'cd /usr/src/app && ./build.sh'
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: dist
path: /usr/src/app/doc-dist
create_branch:
needs: build_docs
runs-on: ubuntu-latest
name: Create new branch
steps:
- name: Checkout docs
uses: actions/checkout@v2
with:
ref: docs
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: dist
path: docsets/Elm
- name: Remove Elm.tgz.txt
run: rm docsets/Elm/Elm.tgz.txt
- name: Display structure of downloaded files
run: ls -R docsets/Elm/
- name: Set the date env value
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Add & Commit
uses: EndBug/[email protected]
with:
new_branch: 'version/${{ env.date }}'
message: 'New Elm packages from ${{ env.date }}'