-
Notifications
You must be signed in to change notification settings - Fork 31
50 lines (47 loc) · 1.62 KB
/
build-and-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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: Build Image
id: build
uses: cern-sis/gh-workflows/.github/actions/docker-build@v6
with:
registry: ${{ env.REGISTRY }}
stage: refextract
image: ${{ env.IMAGE }}
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 }}