Skip to content

Fix issue #3

Fix issue #3 #21

Workflow file for this run

---
name: Container CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
lint-container:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Lint Dockerfile
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile
container:
runs-on: ubuntu-latest
needs: lint-container
if: ${{ success() }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract Python Version
id: extract-python-version
uses: ./.github/actions/extract-python-version
- name: Build
uses: docker/build-push-action@v6
with:
context: .
load: true
file: ./Dockerfile
tags: ${{ github.repository }}:latest
build-args: |
REPOSITORY=${{ github.repository }}
PYTHON_VERSION=${{ steps.extract-python-version.outputs.python-version }}
- name: Test Image
run: |
docker run --rm ${{ github.repository }}
lint-devcontainer:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Lint Dockerfile
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ./.devcontainer/Dockerfile
devcontainer:
runs-on: ubuntu-latest
needs: lint-devcontainer
if: ${{ success() }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
load: true
file: ./.devcontainer/Dockerfile
tags: ${{ github.repository }}:latest