Skip to content

build and publish an image for use on planetpython.org #596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Publish
on:
push:
branches:
- 'main'
permissions:
contents: write
packages: write
jobs:
release-to-ghcr:
concurrency:
group: release-to-ghcr
cancel-in-progress: false
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- { os: ubuntu-24.04, arch: amd64 }
- { os: ubuntu-24.04-arm, arch: arm64 }
steps:
# Checkout push-to-registry action github repository
- name: Checkout Push to Registry action
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login To GHCR
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@v6
with:
context: .
file: Dockerfile.deploy
push: true
tags: |
ghcr.io/python/planetpython:${{ github.sha }}-${{ matrix.config.arch }}
ghcr.io/python/planetpython:latest-${{ matrix.config.arch }}

create-manifests:
runs-on: ubuntu-24.04-arm
needs: [release-to-ghcr]

steps:
- name: Checkout Push to Registry action
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login To GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create SHA image and push
run: |
docker buildx imagetools create \
--tag ghcr.io/python/planetpython:${{ github.sha }} \
ghcr.io/python/planetpython:${{ github.sha }}-amd64 \
ghcr.io/python/planetpython:${{ github.sha }}-arm64

- name: Create latest manifest and push
run: |
docker buildx imagetools create \
--tag ghcr.io/python/planetpython:latest \
ghcr.io/python/planetpython:latest-amd64 \
ghcr.io/python/planetpython:latest-arm64
13 changes: 13 additions & 0 deletions Dockerfile.deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:2.7.18

ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1

RUN mkdir /planet
WORKDIR /planet

COPY code /planet/code
COPY config /planet/config
COPY static /planet/static