Update python:3.13-slim Docker digest to ffd0509 #1491
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: ci | |
| on: [push] | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - run: sudo apt-get install -y --no-install-recommends git-crypt | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| if: github.ref == 'refs/heads/main' | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version-file: pyproject.toml | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: "0.10.4" | |
| enable-cache: true | |
| - name: Initialize Git | |
| run: | | |
| git config --global user.name "Deployer" | |
| git config --global user.email "it-gruppa@foreningenbs.no" | |
| - name: Setup test GitHub App key | |
| env: | |
| TEST_GITHUB_APP_PRIVATE_KEY: ${{ secrets.TEST_GITHUB_APP_PRIVATE_KEY }} | |
| run: | | |
| echo "$TEST_GITHUB_APP_PRIVATE_KEY" > /tmp/test-app-key.pem | |
| chmod 600 /tmp/test-app-key.pem | |
| - run: uv sync --locked --all-extras --dev | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit-${{ env.pythonLocation }}-${{ hashFiles('.pre-commit-config.yaml') }} | |
| - run: uv run pre-commit run --all-files | |
| - run: uv run pytest | |
| env: | |
| GITHUB_APP_ID: ${{ vars.TEST_GITHUB_APP_ID }} | |
| GITHUB_APP_PRIVATE_KEY_PATH: /tmp/test-app-key.pem | |
| GITHUB_APP_INSTALLATION_ID: ${{ vars.TEST_GITHUB_APP_INSTALLATION_ID }} | |
| - name: Build container | |
| id: docker_build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: ${{ github.ref == 'refs/heads/main' }} | |
| tags: ghcr.io/blindern/deployer:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Deploy secondary from primary | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| curl -sS -i -N -L -H "authorization: bearer $DEPLOYER_TOKEN" -H "content-type: application/json" -X POST "https://deployer.foreningenbs.no/deploy?stream" -d ' | |
| { | |
| "service": "deployer-secondary", | |
| "attributes": { | |
| "image": "ghcr.io/blindern/deployer@${{ steps.docker_build.outputs.digest }}" | |
| } | |
| }' | tee /tmp/deploy-output.txt | |
| tail -1 /tmp/deploy-output.txt | grep -q "DEPLOY OK" | |
| env: | |
| DEPLOYER_TOKEN: ${{ secrets.DEPLOYER_TOKEN }} | |
| - name: Deploy primary from secondary | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| curl -sS -i -N -L -H "authorization: bearer $DEPLOYER_TOKEN" -H "content-type: application/json" -X POST "https://deployer-secondary.foreningenbs.no/deploy?stream" -d ' | |
| { | |
| "service": "deployer-primary", | |
| "attributes": { | |
| "image": "ghcr.io/blindern/deployer@${{ steps.docker_build.outputs.digest }}" | |
| } | |
| }' | tee /tmp/deploy-output.txt | |
| tail -1 /tmp/deploy-output.txt | grep -q "DEPLOY OK" | |
| env: | |
| DEPLOYER_TOKEN: ${{ secrets.DEPLOYER_TOKEN }} |