Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render github actions configurations as yaml #1528

Merged
merged 9 commits into from
Nov 24, 2022

Conversation

aktech
Copy link
Member

@aktech aktech commented Oct 31, 2022

Fixes | Closes | Resolves #

Please remove anything marked as optional that you don't need to fill in.
Choose one of the keywords preceding to refer to the issue this PR solves, followed by the issue number (e.g Fixes # 666).
If there is no issue, remove the line. Remove this note after reading.

Changes introduced in this PR:

  • This makes the rendering of GitHub Actions configuration as yaml instead of json for better readability.

Example: nebari-ops.yaml

Before:

{
  "name": "nebari auto update",
  "on": {
    "push": {
      "branches": [
        "main"
      ],
      "paths": [
        "nebari-config.yaml"
      ]
    }
  },
  "env": {
    "GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}",
    "GOOGLE_CREDENTIALS": "${{ secrets.GOOGLE_CREDENTIALS }}"
  },
  "jobs": {
    "build": {
      "name": "nebari",
      "runs-on": "ubuntu-latest",
      "steps": [
        {
          "name": "Checkout Image",
          "uses": "actions/checkout@master",
          "with": {
            "token": "${{ secrets.REPOSITORY_ACCESS_TOKEN }}"
          }
        },
        {
          "name": "Set up Python",
          "uses": "actions/setup-python@v2",
          "with": {
            "python-version": "3.10"
          }
        },
        {
          "name": "Install Nebari",
          "run": "pip install nebari==2022.10.1"
        },
        {
          "name": "Deploy Changes made in nebari-config.yaml",
          "run": "nebari deploy -c nebari-config.yaml --disable-prompt"
        },
        {
          "name": "Push Changes",
          "run": "git config user.email 'nebari@quansight.com' ; git config user.name 'github action' ; git add . ; git diff --quiet && git diff --staged --quiet || (git commit -m '${{ env.COMMIT_MSG }}') ; git push origin main",
          "env": {
            "COMMIT_MSG": "nebari-config.yaml automated commit: ${{ github.sha }}"
          }
        }
      ]
    }
  }
}

After:

name: qhub auto update
'on':
  push:
    branches:
    - main
    paths:
    - qhub-config.yaml
env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
  AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
jobs:
  build:
    name: qhub
    runs-on: ubuntu-latest
    steps:
    - name: Checkout Image
      uses: actions/checkout@master
      with:
        token: ${{ secrets.REPOSITORY_ACCESS_TOKEN }}
    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: '3.10'
    - name: Install QHub
      run: pip install qhub==2022.11.0.dev1+gf35de27.d20221031215607
    - name: Deploy Changes made in qhub-config.yaml
      run: qhub deploy -c qhub-config.yaml --disable-prompt
    - name: Push Changes
      run: git config user.email 'qhub@quansight.com' ; git config user.name 'github
        action' ; git add . ; git diff --quiet && git diff --staged --quiet || (git
        commit -m '${{ env.COMMIT_MSG }}') ; git push origin main
      env:
        COMMIT_MSG: 'qhub-config.yaml automated commit: ${{ github.sha }}'

Types of changes

What types of changes does your PR introduce?

Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds a feature)
  • Breaking change (fix or feature that would cause existing features to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build related changes
  • Other (please describe):

Testing

Requires testing

  • Yes
  • No

In case you checked yes, did you write tests?

  • Yes
  • No

Documentation

Does your contribution include breaking changes or deprecations?
If so have you updated the documentation?

  • Yes, docstrings
  • Yes, main documentation
  • Yes, deprecation notices

Further comments (optional)

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered and more.

aktech and others added 9 commits October 31, 2022 22:38
* 🔄 Synced local '.github/ISSUE_TEMPLATE/' with remote '.github/ISSUE_TEMPLATE/'

MAINT - Sync .github files 🤖

* 🔄 Synced local 'LICENSE' with remote 'LICENSE'

MAINT - Sync .github files 🤖

* 🔄 Synced local 'CONTRIBUTING.md' with remote 'CONTRIBUTING.md'

MAINT - Sync .github files 🤖

* 🔄 Synced local '.github/ISSUE_TEMPLATE/bug-report.yml' with remote '.github/ISSUE_TEMPLATE/bug-report-nebari.yml'

MAINT - Sync .github files 🤖

* 🔄 Synced local '.github/PULL_REQUEST_TEMPLATE.md' with remote '.github/PULL_REQUEST_TEMPLATE_simple.md'

MAINT - Sync .github files 🤖

Co-authored-by: nebari-sensei <null>
MAINT - Sync .github files 🤖

Co-authored-by: nebari-sensei <null>
* 🔄 Synced local '.github/ISSUE_TEMPLATE/' with remote '.github/ISSUE_TEMPLATE/'

MAINT - Sync .github files 🤖

* 🔄 Synced local 'CONTRIBUTING.md' with remote 'CONTRIBUTING.md'

MAINT - Sync .github files 🤖

Co-authored-by: nebari-sensei <null>
MAINT - Sync .github files 🤖

Co-authored-by: nebari-sensei <null>
@trallard trallard added needs: review 👀 This PR is complete and ready for reviewing type: maintenance 🛠 Day-to-day maintenance tasks area:developer-experience 👩🏻‍💻 labels Nov 22, 2022
@iameskild iameskild changed the base branch from main to release/2022.11.1 November 22, 2022 12:21
@iameskild iameskild changed the base branch from release/2022.11.1 to main November 22, 2022 12:22
@iameskild
Copy link
Member

Hi @aktech, thanks for this update! I will circle back to this PR once we have settled on the gitflow workflow we want to use 👍

@iameskild iameskild changed the base branch from main to release/2022.11.1 November 24, 2022 00:43
Copy link
Member

@iameskild iameskild left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪

@iameskild iameskild merged commit 9520129 into release/2022.11.1 Nov 24, 2022
@iameskild iameskild deleted the gh-actions-yaml branch November 24, 2022 00:44
@iameskild iameskild added this to the Release 2022.11.1 milestone Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:developer-experience 👩🏻‍💻 needs: review 👀 This PR is complete and ready for reviewing type: maintenance 🛠 Day-to-day maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants