Add reference to Ansible role in README #136
Workflow file for this run
This file contains hidden or 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
| 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 |