Skip to content

Commit

Permalink
demo: container paths
Browse files Browse the repository at this point in the history
  • Loading branch information
mskrajnowski committed May 29, 2024
0 parents commit 2cefe8c
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Demo

on:
push:

jobs:
build:
name: Build test image
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: ghcr.io/${{ github.repository }}:demo-container-paths

lint:
name: Lint
needs: [build]
runs-on: ubuntu-22.04
container:
image: ghcr.io/${{ github.repository }}:demo-container-paths
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Pyright
uses: jakebailey/pyright-action@v2
with:
version: PATH
working-directory: /opt/demo
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM python:3.11-slim

RUN apt-get update && apt-get install --no-install-recommends --yes \
nodejs \
npm \
&& rm -rf /var/lib/apt/lists/*

RUN npm install --global pyright

RUN useradd --shell "/usr/bin/bash" --create-home demo
RUN mkdir -p /opt/demo && chown demo:demo /opt/demo
WORKDIR /opt/demo
USER demo

COPY ./demo.py ./pyproject.toml ./
1 change: 1 addition & 0 deletions demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"foo" + 1
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[tool.pyright]
include = ["demo.py"]
typeCheckingMode = "strict"

0 comments on commit 2cefe8c

Please sign in to comment.