Bump actions/checkout from 4 to 5 in the github-actions group #121
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: Server docker image | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| tags: | |
| - '[0-9]+.[0-9]+.[0-9]+' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| DEFAULT_PYTHON: '3.13' | |
| jobs: | |
| release: | |
| name: Build & push server image to Dockerhub | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'MobileTeleSystems/syncmaster' # prevent running on forks | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up Python ${{ env.DEFAULT_PYTHON }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.DEFAULT_PYTHON }} | |
| - name: Install poetry | |
| uses: snok/install-poetry@v1 | |
| - name: Get version | |
| id: get_version | |
| run: | | |
| echo "VERSION=$(poetry version --short)" >> $GITHUB_ENV | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: mtsrus/syncmaster-server | |
| labels: | | |
| org.opencontainers.image.title=SyncMaster Server | |
| org.opencontainers.image.vendor=MTS PJSC | |
| org.opencontainers.image.documentation=https://syncmaster.readthedocs.io | |
| org.opencontainers.image.url=https://hub.docker.com/r/mtsrus/syncmaster-server | |
| org.opencontainers.image.authors=DataOps.ETL <[email protected]> | |
| org.opencontainers.image.version=${{ env.VERSION }} | |
| - name: Set platforms | |
| id: set_platforms | |
| run: | | |
| # Building krb5 on ARM is time consuming, do this only at release | |
| if [[ "${{ github.ref_type }}" == "branch" && "${{ github.ref_name }}" == "develop" ]]; then | |
| echo "PLATFORMS=linux/amd64" >> $GITHUB_ENV | |
| elif [[ "${{ github.ref_type }}" == "tag" ]]; then | |
| echo "PLATFORMS=linux/amd64,linux/arm64/v8" >> $GITHUB_ENV | |
| fi | |
| - name: Build Server image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| target: prod | |
| file: docker/Dockerfile.server | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| pull: true | |
| push: true | |
| cache-to: type=gha,mode=max,scope=server | |
| cache-from: type=gha,scope=server | |
| platforms: ${{ env.PLATFORMS }} | |
| provenance: mode=max | |
| sbom: true | |
| - name: Convert README to Markdown | |
| uses: docker://pandoc/core:2.9 | |
| with: | |
| args: >- | |
| --output=README.md | |
| --from=rst | |
| --to=gfm | |
| --wrap=none | |
| README.rst | |
| - name: Update DockerHub Description | |
| uses: peter-evans/dockerhub-description@v4 | |
| if: github.ref_type == 'tag' | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| # this requires token with read+write+delete permissions. read+write is not enough! | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| repository: mtsrus/syncmaster-server | |
| short-description: ${{ github.event.repository.description }} (Server) | |
| enable-url-completion: true |