Skip to content

Commit 330ccf3

Browse files
committed
GitHub actions: add Docker image build
1 parent 702f325 commit 330ccf3

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# https://github.com/devcontainers/images/tree/main/src/python
22
FROM mcr.microsoft.com/devcontainers/python:1-3.12-bookworm
33

4-
# [Optional] Uncomment this section to install additional packages.
4+
# Install additional packages.
55
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
66
# && apt-get -y install --no-install-recommends \
7-
# <your-package-list-here> \
7+
# <your-package-list-here> \
88
# && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
99

1010
# Install pipenv dependencies
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build and publish Docker image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- ".devcontainer/Dockerfile"
9+
pull_request:
10+
branches:
11+
- main
12+
paths:
13+
- ".devcontainer/Dockerfile"
14+
15+
jobs:
16+
build-and-publish:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Set up QEMU
24+
uses: docker/setup-qemu-action@v3
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: Log in to GitHub Container Registry
30+
uses: docker/login-action@v3
31+
with:
32+
registry: ghcr.io
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Build and push Docker image
37+
uses: docker/build-push-action@v6
38+
with:
39+
context: .
40+
file: .devcontainer/Dockerfile
41+
push: true
42+
tags: ghcr.io/${{ github.repository_owner }}/project-python:latest

0 commit comments

Comments
 (0)