Repository navigation
Add dark mode with theme toggle next to username #156
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 | |
| on: | |
| - push | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| - name: Setup Poetry | |
| uses: abatilo/actions-poetry@v4 | |
| - name: Cache the virtualenv | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pypoetry | |
| key: venv-${{ hashFiles('poetry.lock') }} | |
| - name: Install Poetry dependencies | |
| run: poetry install | |
| - name: Run black | |
| run: poetry run black --check *.py | |
| - name: Run flake8 | |
| run: poetry run flake8 *.py | |
| - name: Run pylint | |
| run: poetry run pylint *.py | |
| - name: Run mypy | |
| run: poetry run mypy --strict --scripts-are-modules *.py | |
| docker: | |
| name: Docker | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| id: build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| tags: ghcr.io/robojackets/checkpoint:latest | |
| network: host | |
| pull: true | |
| push: true | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| outputs: | |
| image-digest: ${{ steps.build.outputs.digest }} | |
| deploy-production: | |
| name: Deploy | |
| needs: [lint, docker] | |
| uses: ./.github/workflows/deploy.yml | |
| concurrency: | |
| group: deploy-production | |
| cancel-in-progress: true | |
| permissions: | |
| id-token: write | |
| contents: read | |
| packages: read | |
| with: | |
| image-digest: ${{ needs.docker.outputs.image-digest }} | |
| environment: production | |
| prune-stale-images: | |
| name: Prune stale images | |
| runs-on: ubuntu-latest | |
| needs: [docker, deploy-production] | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| permissions: | |
| packages: write | |
| steps: | |
| - uses: snok/container-retention-policy@v3.0.1 | |
| with: | |
| account: robojackets | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| image-names: checkpoint | |
| skip-shas: ${{ needs.docker.outputs.image-digest }} | |
| cut-off: 1h |