Skip to content

Bump urllib3 from 2.2.1 to 2.2.2 (#16) #25

Bump urllib3 from 2.2.1 to 2.2.2 (#16)

Bump urllib3 from 2.2.1 to 2.2.2 (#16) #25

Workflow file for this run

name: Build Docker
on:
push:
branches:
- main
release:
types:
- created
workflow_dispatch:
permissions:
contents: read
packages: write
env:
IMAGE_NAME: aoirint/live_inbox_updater
IMAGE_TAG: ${{ github.event.release.tag_name != '' && github.event.release.tag_name || 'latest' }}
VERSION: ${{ (github.event.release.tag_name != '' && github.event.release.tag_name) || '0.0.0' }}
jobs:
docker-build-and-push:
strategy:
max-parallel: 1
fail-fast: false
matrix:
include:
- docker_image_registry: 'ghcr.io'
docker_cache_registry: 'ghcr.io'
- docker_image_registry: 'docker.io'
docker_cache_registry: 'ghcr.io'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry (ghcr.io)
uses: docker/login-action@v3
with:
registry: 'ghcr.io'
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub (docker.io)
uses: docker/login-action@v3
with:
registry: 'docker.io'
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Replace Version
shell: bash
run: |
sed -i "s/__version__ = \"0.0.0\"/__version__ = \"${{ env.VERSION }}\"/" live_inbox_updater/__init__.py
sed -i "s/version = \"0.0.0\"/version = \"${{ env.VERSION }}\"/" pyproject.toml
- name: Build and Deploy Docker image
uses: docker/build-push-action@v5
env:
IMAGE_NAME_AND_TAG: ${{ format('{0}/{1}:{2}', matrix.docker_image_registry, env.IMAGE_NAME, env.IMAGE_TAG) }}
IMAGE_CACHE_FROM: ${{ format('type=registry,ref={0}/{1}:latest-buildcache', matrix.docker_cache_registry, env.IMAGE_NAME) }}
IMAGE_CACHE_TO: ${{ env.IMAGE_TAG == 'latest' && format('type=registry,ref={0}/{1}:latest-buildcache,mode=max', matrix.docker_cache_registry, env.IMAGE_NAME) || '' }}
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
file: ./Dockerfile
push: true
tags: ${{ env.IMAGE_NAME_AND_TAG }}
cache-from: ${{ env.IMAGE_CACHE_FROM }}
cache-to: ${{ env.IMAGE_CACHE_TO }}