Skip to content

Add reference to Ansible role in README #136

Add reference to Ansible role in README

Add reference to Ansible role in README #136

Workflow file for this run

name: Build and Push Docker Image
on:
workflow_run:
workflows:
- "Pylint Check"
- "Run Unit Tests"
types:
- completed
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Get version from version.py
id: get_version
run: |
VERSION=$(python -c "from pyproxy.utils.version import __version__; print(__version__)")
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "Docker tag version: $VERSION"
- name: Convert repository owner to lowercase
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Build Docker image
run: |
docker build -t ghcr.io/${{ env.REPO_OWNER }}/pyproxy:${{ env.VERSION }} -t ghcr.io/${{ env.REPO_OWNER }}/pyproxy:latest .
- name: Build Docker slim image
run: |
docker build -f Dockerfile.slim -t ghcr.io/${{ env.REPO_OWNER }}/pyproxy:${{ env.VERSION }}-slim -t ghcr.io/${{ env.REPO_OWNER }}/pyproxy:latest-slim .
- name: Push Docker image
run: |
docker push ghcr.io/${{ env.REPO_OWNER }}/pyproxy:${{ env.VERSION }}-slim
docker push ghcr.io/${{ env.REPO_OWNER }}/pyproxy:latest-slim
docker push ghcr.io/${{ env.REPO_OWNER }}/pyproxy:${{ env.VERSION }}
docker push ghcr.io/${{ env.REPO_OWNER }}/pyproxy:latest