Skip to content

Commit

Permalink
Added CI pipeline (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
kohlerdominik authored Jan 31, 2024
1 parent 9ccf6e2 commit 1a2c0c6
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 3 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build Image and push it to GHCR

on:
push:
tags:
- "v*"
pull_request:
branches:
- "master"

jobs:
build-push:
name: Build & Push
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Get Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push the Image
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ The web service is written in Python using the aiohttp web server.
## Usage

To start the webservice just run

```
docker-compose up
docker compose up
```

The html file and and any additional files must be uploaded as multipart/form-data
Expand All @@ -30,3 +31,20 @@ Example:
```
curl -F "html=@tests/index.html" -F "asset.universe.jpg=@tests/universe.jpg" http://localhost:3000 -o test.pdf
```

## Development

For development, you should clone this repo with

```
git clone https://github.com/enertech-ch/weasyprint-docker.git
```

and create a new branch.

To test your changes, you can build the image locally and start your local build with

```
docker compose build weasyprint
docker compose up weasyprint
```
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ services:
build:
context: .
dockerfile: Dockerfile
image: 4teamwork/weasyprint:latest
image: ghcr.io/enertech-ch/weasyprint-docker:latest
ports:
- 3000:8080
- 3000:8080

0 comments on commit 1a2c0c6

Please sign in to comment.