Feature/bmc 25307 (#63) #333
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: General workflow | |
on: | |
push: | |
pull_request: | |
branches: | |
- master | |
env: | |
# Use docker.io for Docker Hub if empty | |
REGISTRY: ghcr.io | |
# github.repository as <account>/<repo> | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
lint: | |
runs-on: ubuntu-22.04 | |
container: python:3.9.20-alpine3.20 | |
env: | |
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Install and run pylint | |
run: | | |
apk add --no-cache --update python3-dev gcc build-base | |
pip install pylint | |
pip install --requirement requirements.txt | |
pylint automation/*.py -d R,C,W0511 | |
build_and_publish: | |
needs: [lint] | |
if: startsWith(github.ref, 'refs/tags/') | |
name: Push Docker image to GitHub Container Registry | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Get the version | |
id: get_version | |
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
- name: Log in to registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push to GitHub Container Registry | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.get_version.outputs.VERSION }} |