build(dependency): ⬆️ bump markupsafe from 2.1.3 to 2.1.4 #1177
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
# SPDX-FileCopyrightText: © 2023 Romain Brault <mail@romainbrault.com> | |
# | |
# SPDX-License-Identifier: MIT | |
name: Container | |
env: | |
PYTHON_VERSION: "3.11" | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
on: | |
push: | |
branches: ["main"] | |
tags: ["v*"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
metadata: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4.7.1 | |
id: setup-python | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
check-latest: true | |
- name: Upgrade python environment | |
run: | | |
pip install --constraint=.github/workflows/constraints.txt pip | |
pip --version | |
- name: Install Poetry | |
run: | | |
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry | |
echo "version=$(poetry version --short)" >> "$GITHUB_OUTPUT" | |
poetry --version | |
- name: Check if there is a parent commit | |
id: check-parent-commit | |
run: | | |
echo "name=sha::$(git rev-parse --verify --quiet HEAD^)" >> $GITHUB_OUTPUT | |
- name: Detect and tag new version | |
id: check-version | |
if: steps.check-parent-commit.outputs.sha | |
uses: salsify/action-detect-and-tag-new-version@v2.0.3 | |
with: | |
version-command: poetry version --short | |
build-container: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
needs: metadata | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: metadata | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=pep440,pattern={{version}} | |
- name: Build Container Image And Push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: Containerfile | |
build-args: | | |
BUILD_DATE=${{ github.event.repository.updated_at }} | |
VERSION=${{ needs.metadata.outputs.version }} | |
REVISION=${{ github.sha }} | |
TAG=${{ steps.metadata.outputs.tags }} | |
tags: ${{ steps.metadata.outputs.tags }} | |
push: ${{ github.event_name != 'pull_request' }} | |
labels: ${{ steps.metadata.outputs.labels }} |