Partial fix of build pipeline (#41)

This commit is contained in:
George V 2021-02-24 02:00:32 +02:00 committed by GitHub
parent 57e5019d64
commit 9f30e2d748
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 51 deletions

View File

@ -8,56 +8,34 @@ on:
jobs: jobs:
buildx: buildx:
runs-on: ubuntu-latest runs-on: ubuntu-18.04
steps: steps:
- - name: Checkout
name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
-
name: Prepare
id: prepare
run: |
DOCKER_IMAGE=caronc/apprise
DOCKER_PLATFORMS=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386
VERSION=edge
if [[ $GITHUB_REF == refs/tags/* ]]; then - name: Docker meta
VERSION=${GITHUB_REF#refs/tags/v} id: docker_meta
fi uses: crazy-max/ghaction-docker-meta@v1
with:
images: ${{ secrets.DOCKER_HUB_REPO }}
TAGS="--tag ${DOCKER_IMAGE}:${VERSION}" - name: Set up QEMU
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then uses: docker/setup-qemu-action@v1
TAGS="$TAGS --tag ${DOCKER_IMAGE}:latest"
fi
echo ::set-output name=docker_image::${DOCKER_IMAGE} - name: Set up Docker Buildx
echo ::set-output name=version::${VERSION} uses: docker/setup-buildx-action@v1
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} \
--build-arg VERSION=${VERSION} \ - name: Login to DockerHub
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
--build-arg VCS_REF=${GITHUB_SHA::8} \
${TAGS} .
-
name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v3
-
name: Docker Buildx (build)
run: |
docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args }}
-
name: Login to DockerHub
if: success() && github.event_name != 'pull_request'
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_HUB_PASSWORD }}
-
name: Docker Buildx (push) - name: Build and push
if: success() && github.event_name != 'pull_request' uses: docker/build-push-action@v2
run: | with:
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }} context: .
- platforms: linux/amd64,linux/386,linux/arm64
name: Inspect image push: ${{ github.event_name != 'pull_request' }}
if: always() && github.event_name != 'pull_request' tags: ${{ steps.docker_meta.outputs.tags }}
run: | labels: ${{ steps.docker_meta.outputs.labels }}
docker buildx imagetools inspect ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}

View File

@ -12,13 +12,13 @@ ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1 ENV PYTHONUNBUFFERED 1
ENV APPRISE_CONFIG_DIR /config ENV APPRISE_CONFIG_DIR /config
# Install nginx and supervisord
RUN apt-get update -qq && \
apt-get install -y -qq nginx supervisor build-essential libffi-dev libssl-dev python-dev rustc
# Install requirements and gunicorn # Install requirements and gunicorn
COPY ./requirements.txt /etc/requirements.txt COPY ./requirements.txt /etc/requirements.txt
RUN pip3 install -r /etc/requirements.txt gunicorn RUN pip3 install -qq -r /etc/requirements.txt gunicorn
# Install nginx and supervisord
RUN apt-get update && \
apt-get install -y nginx supervisor
# Nginx configuration # Nginx configuration
RUN echo "daemon off;" >> /etc/nginx/nginx.conf RUN echo "daemon off;" >> /etc/nginx/nginx.conf
@ -39,6 +39,12 @@ COPY apprise_api/ webapp
# Change port of gunicorn # Change port of gunicorn
RUN sed -i -e 's/:8000/:8080/g' /opt/apprise/webapp/gunicorn.conf.py RUN sed -i -e 's/:8000/:8080/g' /opt/apprise/webapp/gunicorn.conf.py
# Cleanup
RUN apt-get remove -y -qq build-essential libffi-dev libssl-dev python-dev rustc && \
apt-get clean autoclean && \
apt-get autoremove --yes && \
rm -rf /var/lib/{apt,dpkg,cache,log}/
EXPOSE 8000 EXPOSE 8000
VOLUME /config VOLUME /config