Skip to content

Commit

Permalink
Add simple workflow
Browse files Browse the repository at this point in the history
Change-Id: Iae5adac03d980d5f0dc7ad704502cfae829c7bd6
  • Loading branch information
oxve committed Jun 13, 2024
1 parent 5e8fa2d commit a78a235
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .github/actions/pre_commit/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ inputs:
runs:
using: "composite"
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install Pip Packages
shell: bash
run: pip install --require-hashes --no-deps -r ${GITHUB_WORKSPACE}/precommit_hooks/requirements.txt
- run: pre-commit run --show-diff-on-failure --color=always --from-ref ${{ inputs.base_ref }} --to-ref HEAD
shell: bash
env:
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/developer_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Cobalt Developer Site

on:
pull_request:
push:
branches:
- main
- feature/*

concurrency:
group: '${{ github.workflow }}-${{ github.event_name }}-${{ inputs.platform }} @ ${{ github.event.pull_request.number || github.sha }}'
cancel-in-progress: true

permissions: {}

jobs:
developer-docs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: kaidokert/[email protected]
with:
fetch-depth: 1
persist-credentials: false
- name: Docker Build
run: docker build -t docsite --build-arg UID=$(id -u) --build-arg GID=$(id -g) cobalt/site/docker
shell: bash
- name: Docker Run
run: docker run --mount type=bind,source=$(pwd),target=/code docsite
shell: bash
- name: Add changes to git
run: git add -A
shell: bash
- name: Run pre-commit
uses: ./.github/actions/pre_commit
with:
base_ref: ${{ github.event.pull_request.base.sha || github.event.before }}
- name: Add changes to git (again)
run: |
git add -A
git commit -m 'Documentation updates'
shell: bash

- name: Git print diff
run: git show
shell: bash

- name: Create Pull Request
id: create-pr
continue-on-error: true
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3
with:
# token: ${{ secrets.CHERRY_PICK_TOKEN }}
base: ${{ github.base_ref }}
branch: ${{ github.head_ref || github.ref_name }}
committer: GitHub Release Automation <[email protected]>
title: "Documentation change for #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}"
body: |
Refer to the original PR: https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}
${{ github.event.pull_request.body }}
8 changes: 0 additions & 8 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install Pip Packages
run: pip install --require-hashes --no-deps -r ${GITHUB_WORKSPACE}/precommit_hooks/requirements.txt
- name: Download Resources
run: python ${GITHUB_WORKSPACE}/download_resources.py
- name: Run pre-commit
uses: ./.github/actions/pre_commit
with:
Expand Down

0 comments on commit a78a235

Please sign in to comment.