This repository has been archived by the owner on Oct 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 116
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
5 changed files
with
65 additions
and
51 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Build and push | ||
|
||
on: | ||
pull_request: | ||
branches: [ master ] | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test_build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Build | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
platforms: linux/amd64,linux/arm64, linux/arm/v7 | ||
|
||
build_and_push: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/master' | ||
needs: test_build | ||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
platforms: linux/amd64,linux/arm64, linux/arm/v7 | ||
labels: | | ||
org.opencontainers.image.source=https://github.com/${{ github.repository }} | ||
org.opencontainers.image.revision=${{ github.sha }} | ||
tags: | | ||
${{ secrets.DOCKER_USERNAME }}/bt-mqtt-gateway:${{ github.sha }} | ||
${{ secrets.DOCKER_USERNAME }}/bt-mqtt-gateway:latest |
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,23 +1,21 @@ | ||
FROM python:3.8-alpine3.12 | ||
FROM python:3.8-alpine | ||
|
||
ENV DEBUG false | ||
|
||
RUN mkdir application | ||
WORKDIR /application | ||
|
||
COPY requirements.txt /application | ||
|
||
RUN apk add --no-cache tzdata bluez bluez-libs sudo bluez-deprecated && \ | ||
ln -s /config.yaml ./config.yaml && \ | ||
pip install -r requirements.txt | ||
|
||
RUN mkdir /application | ||
COPY . /application | ||
|
||
RUN apk add --no-cache --virtual build-dependencies git bluez-dev musl-dev make gcc glib-dev musl-dev && \ | ||
pip install `./gateway.py -r all` && \ | ||
WORKDIR /application | ||
|
||
RUN apk add --no-cache tzdata bluez bluez-libs sudo bluez-deprecated && \ | ||
apk add --no-cache --virtual build-dependencies git bluez-dev musl-dev make gcc glib-dev musl-dev && \ | ||
pip install --no-cache-dir -r requirements.txt && \ | ||
pip install --no-cache-dir `./gateway.py -r all` && \ | ||
apk del build-dependencies | ||
|
||
COPY ./start.sh /start.sh | ||
RUN chmod +x /start.sh | ||
|
||
VOLUME /application/config.yaml | ||
|
||
ENTRYPOINT ["/bin/sh", "-c", "/start.sh"] |
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 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