Skip to content

Commit

Permalink
github action for publish
Browse files Browse the repository at this point in the history
  • Loading branch information
silvanmelchior-zuehlke committed Jul 29, 2023
1 parent dee8f38 commit 8a3632c
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: publish

on:
release:
types: [published]

env:
INTERPRETER_IMAGE: silvanmelchior/interpreter-venv
OUTPUT_IMAGE: silvanmelchior/incognito-pilot
PLATFORMS: linux/amd64,linux/arm64/v8

jobs:
publish:
runs-on: ubuntu-latest
strategy:
matrix:
dependencies:
- suffix: ""
interpreter: 1.0.0
- suffix: "-slim"
interpreter: 1.0.0-slim

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Get version
run: |
VER=$(cat VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV
- name: Get release type
run: |
VER=$(cat VERSION)
if [[ $VER == *"b"* ]]; then
echo "RELEASE_TYPE=nightly" >> $GITHUB_ENV
else
echo "RELEASE_TYPE=latest" >> $GITHUB_ENV
fi
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: ${{ env.PLATFORMS }}
file: docker/Dockerfile
build-args: INTERPRETER_IMAGE=${{ env.INTERPRETER_IMAGE }}:${{ matrix.dependencies.interpreter }}
push: true
tags: |
${{ env.OUTPUT_IMAGE }}:${{ env.VERSION }}${{ matrix.dependencies.suffix }},
${{ env.OUTPUT_IMAGE }}:${{ env.RELEASE_TYPE }}${{ matrix.dependencies.suffix }}
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ RUN cd ui && \

COPY VERSION VERSION
COPY docker/start* .
RUN chmod 755 start*
CMD ["/opt/app/start.sh"]

0 comments on commit 8a3632c

Please sign in to comment.