Skip to content

changes

changes #9

Workflow file for this run

name: Docker Image
on:
push:
branches: [ "*" ]
tags: [ 'v*.*.*' ]
paths:
- '.github/workflows/docker.yml'
- 'conf/**'
- 'monitorizer/**'
- 'pyproject.toml'
- 'Dockerfile'
- '*-entrypoint.sh'
pull_request:
branches: [ "*" ]
paths:
- '.github/workflows/docker.yml'
- 'conf/**'
- 'monitorizer/**'
- 'pyproject.toml'
- 'Dockerfile'
- '*-entrypoint.sh'
env:
REGISTRY: ghcr.io
PEP_IMAGE: ${{ github.repository }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta_base
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.PEP_IMAGE }}
- name: Build and push pep image
uses: docker/build-push-action@v4
with:
context: .
build-args: |
version=${{ github.sha }}@${{ github.ref_name }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta_base.outputs.tags }}
labels: ${{ steps.meta_base.outputs.labels }}