-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
104 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/.git | ||
|
||
# .gitignore | ||
/.meltano/ | ||
/output/ | ||
/logs/ | ||
/.env | ||
/.python-version |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,74 @@ | ||
name: Render app to image | ||
name: Build, Test, Push | ||
|
||
on: | ||
push: | ||
schedule: | ||
- cron: "0 0 * * 0" | ||
- cron: "0 0 * * 0" | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
render: | ||
build-test-push: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
### Build | ||
- name: Build / Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Install FFmpeg | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y ffmpeg | ||
- name: Install Pixlet | ||
run: | | ||
export PIXLET_VERSION=$(curl https://raw.githubusercontent.com/tidbyt/community/main/PIXLET_VERSION | sed 's/v//') | ||
echo $PIXLET_VERSION | ||
curl -L -o pixlet.tar.gz https://github.com/tidbyt/pixlet/releases/download/v${PIXLET_VERSION}/pixlet_${PIXLET_VERSION}_linux_amd64.tar.gz | ||
tar -xvf pixlet.tar.gz | ||
chmod +x ./pixlet | ||
mv pixlet /usr/local/bin/pixlet | ||
- name: Install Python | ||
uses: actions/setup-python@v4.7.0 | ||
|
||
- name: Build / Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Build / Extract Docker metadata (tags, labels) | ||
id: meta | ||
uses: docker/metadata-action@v4.6.0 | ||
with: | ||
python-version: 3.11.1 | ||
- name: Install Meltano | ||
run: pip install meltano | ||
- name: Install Meltano plugins | ||
run: meltano install | ||
- name: Render app to image | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build / Build Docker image | ||
uses: docker/build-push-action@v4.1.1 | ||
with: | ||
context: . | ||
load: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
### Test | ||
- name: Test / Render app to image | ||
env: | ||
FFMPEG_SOURCE_URL: "rtsp://zephyr.rtsp.stream/pattern?streamKey=${{secrets.RTSP_STREAM_KEY}}" | ||
TAP_PIXLET_MAGNIFICATION: "8" | ||
run: | | ||
meltano run webp | ||
mv output/**/*.webp output/image.webp | ||
- name: Store image | ||
docker run -v "$(pwd)/output:/project/output" -e TAP_PIXLET_MAGNIFICATION=8 -e FFMPEG_SOURCE_URL=$FFMPEG_SOURCE_URL ${{ steps.meta.outputs.tags }} | ||
sudo mv output/**/*.webp output/image.webp | ||
- name: Test / Store image | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: image | ||
path: output/image.webp | ||
|
||
### Push | ||
- name: Push / Log in to the Container registry | ||
uses: docker/login-action@v2.2.0 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Push / Push Docker image | ||
uses: docker/build-push-action@v4.1.1 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/.meltano/ | ||
/.meltano | ||
/output/ | ||
/logs/ | ||
/.env | ||
/.python-version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ARG PIXBYT_IMAGE=ghcr.io/douwem/pixbyt:main | ||
FROM $PIXBYT_IMAGE as base | ||
|
||
ENV APP_NAME=ffmpeg | ||
|
||
WORKDIR /project | ||
|
||
# Copy app files | ||
COPY ./ ./apps/${APP_NAME} | ||
|
||
# Install apt packages for apps | ||
RUN cat ./apps/**/apt-packages.txt | sort | uniq > ./apps/apt-packages.txt | ||
RUN xargs -a apps/apt-packages.txt apt-get install -y | ||
|
||
# Install Meltano plugins for apps | ||
RUN meltano --log-level=debug install extractors tap-pixlet--${APP_NAME} | ||
|
||
ENTRYPOINT [] | ||
CMD meltano run ${APP_NAME}--webp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.