Skip to content

remove extra port address #2

remove extra port address

remove extra port address #2

Workflow file for this run

name: Serve-Python workflow
on:
push:
paths:
- "serve-python/**"
# Adds ability to run this workflow manually
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
tags:
description: 'Manual run'
required: false
type: boolean
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@main
- name: 'Build test image'
run: |
docker build -t python-test-image -f ./serve-python/Dockerfile.test ./serve-python
- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
with:
image-ref: 'python-test-image'
format: 'table'
severity: 'CRITICAL,HIGH'
security-checks: 'vuln'
timeout: '59m59s'
exit-code: '0'
- name: 'Run tests'
env:
IMAGE_NAME: python-test-image
run: |
pip install -r ./serve-python/tests/requirements.txt
python3 -m pytest ./serve-python
push:
if: |
github.ref == 'refs/heads/main' &&
github.repository == 'scilifelabdatacentre/serve-images'
needs: build_and_test
runs-on: ubuntu-latest
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
permissions:
contents: read
packages: write
steps:
- name: 'Checkout github action'
uses: actions/checkout@main
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/scilifelabdatacentre/serve-python
tags: |
type=raw,value={{date 'YYMMDD-HHmm' tz='Europe/Stockholm'}}
- name: 'Login to GHCR'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Publish image to GHCR
uses: docker/build-push-action@v3
with:
file: ./serve-python/Dockerfile
context: ./serve-python
push: true
build-args: version=${{ github.ref_name }}
tags: |
${{ steps.meta.outputs.tags }}
ghcr.io/scilifelabdatacentre/serve-python:latest
labels: ${{ steps.meta.outputs.labels }}