Skip to content

Commit 1e9b8db

Browse files
Create docker-image.yml (#1184)
* Create docker-image.yml Added a workflow to build the docker image automatically. * Add files via upload * Update Dockerfile * Update docker-image.yml * Update docker-image.yml * Update docker-image.yml * Update docker-image.yml step 1 * Update docker-image.yml * Update docker-image.yml * Update Dockerfile making it so it will update the install version of amulet when built. before it wouldn't do anything unless the Docker file was manually edited. * Update docker-image.yml did the other side of the code * Update Dockerfile changing fall back version * Update Dockerfile * Update Dockerfile
1 parent 4889915 commit 1e9b8db

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.github/workflows/docker-image.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Docker Image CI
2+
3+
on:
4+
workflow_run:
5+
workflows: [python-build]
6+
types:
7+
- completed
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v4
16+
17+
- name: Build Docker image
18+
run: |
19+
docker build \
20+
. \
21+
--file Dockerfile \
22+
--tag amulet-editor:latest \
23+
--build-arg AMULET_VERSION=${{ github.event.release.tag_name }}
24+
25+
- name: Save Docker image to tar archive
26+
run: |
27+
docker save amulet-editor:latest -o amulet-editor.tar
28+
29+
- name: Upload Release Asset
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
run: |
33+
gh release upload ${{ github.event.release.tag_name }} \
34+
amulet-editor.tar#Amulet-v${{ github.event.release.tag_name }}-docker.tar

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM python:3.9-bullseye
2+
RUN apt-get update && apt install libgtk-3-dev dbus-x11 wget libnotify4 -y
3+
RUN pip install --upgrade pip
4+
RUN wget https://extras.wxpython.org/wxPython4/extras/linux/gtk3/debian-11/wxPython-4.2.0-cp39-cp39-linux_x86_64.whl && pip install wxPython-4.2.0-cp39-cp39-linux_x86_64.whl
5+
ARG AMULET_VERSION # defaults to the latest version if no arg is given in build command.
6+
RUN pip install amulet-map-editor==$AMULET_VERSION
7+
RUN apt-get install libSDL2-2.0 -y
8+
9+
ENTRYPOINT [ "/usr/local/bin/python", "-m", "amulet_map_editor" ]

0 commit comments

Comments
 (0)