Skip to content

Merge pull request #4 from forticheprod/3-add-quality-ci-quality-with… #3

Merge pull request #4 from forticheprod/3-add-quality-ci-quality-with…

Merge pull request #4 from forticheprod/3-add-quality-ci-quality-with… #3

name: "test_build_and_release"
on:
push:
branches:
- main
- master
pull_request:
workflow_dispatch:
release:
types: [created]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Ruff
uses: chartboost/ruff-action@v1
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Black
uses: psf/black@stable
build_and_release:
runs-on: ubuntu-latest
needs: [ruff, black]
if: github.event_name == 'release' && github.event.action == 'created'
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push to container registry
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}