Skip to content

add branch to yaml #1053

add branch to yaml

add branch to yaml #1053

name: pyright-ratchet
on: [push]
env:
DOCKER_REPO: us.gcr.io/cds-docker-containers/depmapomics
DOCKER_TAG: ga-build-${{ github.run_number }}
BRANCH_NAME: master
jobs:
check-pyright:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
poetry-version: ["1.8.3"]
steps:
- name: print branch
run: echo ${{ env.BRANCH_NAME }}
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install dependencies
run: poetry install
- name: Run pyratchet
run: poetry run pyright-ratchet run pyright depmapomics
build-docker:
needs: check-pyright
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Update build id
run: |
echo "SHA=\"${{ github.sha }}\"" > depmapomics/build.py
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GCR
uses: docker/login-action@v2
with:
registry: us.gcr.io
username: _json_key
password: "${{ secrets.DEPLOY_SVC_ACCT }}"
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }},${{ env.DOCKER_REPO }}:${{ env.BRANCH_NAME }}
cache-from: type=gha
cache-to: type=gha,mode=max