Skip to content

Commit

Permalink
Add support for armv7
Browse files Browse the repository at this point in the history
  • Loading branch information
Anze committed Jan 21, 2021
1 parent 2edc493 commit 1e10e97
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/on_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ jobs:
uses: actions/checkout@v1


- name: Set up QEMU for more platforms
uses: docker/setup-qemu-action@v1
with:
platforms: all


- name: Set docker build as alias to buildx (multiarch build)
uses: docker/setup-buildx-action@v1
id: buildx
with:
install: false


- name: Deploy to Docker Hub
if: success() && startsWith(github.ref, 'refs/tags/v')
env:
Expand All @@ -22,14 +35,15 @@ jobs:
DOCKER_IMAGE: grafolean/grafolean-ping-bot
DOCKER_USER: grafolean
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
BUILD_PLATFORMS: linux/arm/v7
run: |
echo "Available plaftorms: ${{ steps.buildx.outputs.platforms }}"
echo "Building for plaftorms: $BUILD_PLATFORMS"
export VERSION=${GITHUB_REF_TAG:10:50}
echo "Version is $VERSION"
export LAST_KNOWN_VERSION=`git tag -l --sort=-version:refname "v*.*.*" | grep -v rc | head -n 1 | tr -d '[:space:]'`
echo "Last known version is $LAST_KNOWN_VERSION"
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD $DOCKER_REGISTRY
docker build -t "docker.io/$DOCKER_IMAGE:$VERSION" -t "docker.io/$DOCKER_IMAGE:latest" --build-arg VERSION=$VERSION --build-arg VCS_REF=$GITHUB_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') .
[ "$LAST_KNOWN_VERSION" == "$VERSION" ] && docker tag "docker.io/$DOCKER_IMAGE:$VERSION" "docker.io/$DOCKER_IMAGE:latest" || echo "NOT MARKING AS LATEST!"
docker images
docker push "docker.io/$DOCKER_IMAGE:$VERSION"
[ "$LAST_KNOWN_VERSION" == "$VERSION" ] && docker push "docker.io/$DOCKER_IMAGE:latest" || echo "NOT LATEST!"
docker pull "docker.io/$DOCKER_IMAGE" || true
[ "$LAST_KNOWN_VERSION" == "$VERSION" ] && echo "MARKING AS LATEST!" || echo "NOT MARKING AS LATEST!"
[ "$LAST_KNOWN_VERSION" == "$VERSION" ] && docker buildx build --push --platform "$BUILD_PLATFORMS" -t "docker.io/$DOCKER_IMAGE:$VERSION" -t "docker.io/$DOCKER_IMAGE:latest" --build-arg VERSION=$VERSION --build-arg VCS_REF=$GITHUB_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') . || docker buildx build --push --platform "$BUILD_PLATFORMS" -t "docker.io/$DOCKER_IMAGE:$VERSION" --build-arg VERSION=$VERSION --build-arg VCS_REF=$GITHUB_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') .
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ FROM python:3.6-slim-stretch as python-requirements
COPY ./Pipfile ./Pipfile.lock /pingbot/
WORKDIR /pingbot
RUN \
apt-get update && \
apt-get install -q -y git build-essential libpq-dev python3-dev libffi-dev && \
pip install pipenv && \
pipenv lock -r > /requirements.txt

Expand Down

0 comments on commit 1e10e97

Please sign in to comment.