Skip to content

Merge pull request #114 from DonHaul/fix-build #139

Merge pull request #114 from DonHaul/fix-build

Merge pull request #114 from DonHaul/fix-build #139

name: Pull request master (lint and test)
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
lint_and_test:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Lint - Pre-commit check
uses: pre-commit/[email protected]
- name: Prep Build
uses: docker/setup-buildx-action@v3
- name: Build Docker image
run: docker build --target refextract-tests -t refextract .
- name: Run tests
run: >
docker run
--entrypoint poetry
refextract
run pytest
push_and_deploy:
runs-on: ubuntu-latest
needs: [lint_and_test]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Build Image
id: build
uses: cern-sis/gh-workflows/.github/actions/docker-build@v6
with:
registry: registry.cern.ch
stage: refextract
image: cern-sis/inspirehep/refextract
cache: false
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}
- name: Deploy QA
uses: cern-sis/gh-workflows/.github/actions/kubernetes-project-new-images@v6
with:
event-type: update
images: ${{ env.REGISTRY }}/${{ env.IMAGE }}@${{ steps.build.outputs.image-digest }}
token: ${{ secrets.PAT_FIRE_EVENTS_ON_CERN_SIS_KUBERNETES }}