From 6a523f1acacb4d2b9cd59b4434a11adc49b6bf80 Mon Sep 17 00:00:00 2001 From: jrk Date: Mon, 29 Apr 2024 02:35:08 +0200 Subject: [PATCH] add docker build --- .env.dist | 4 +++ .github/workflows/master.yml | 48 ++++++++++++++++++++++++++++++++++++ version.txt | 1 + 3 files changed, 53 insertions(+) create mode 100755 .env.dist create mode 100755 .github/workflows/master.yml create mode 100755 version.txt diff --git a/.env.dist b/.env.dist new file mode 100755 index 0000000..e85a698 --- /dev/null +++ b/.env.dist @@ -0,0 +1,4 @@ +DEBUG=false +PORT=5000 +AUTOCONFIGURE_REVERSE_PROXY_MODE=false +AUTOCONFIGURE_LX_FILE=/home/pi/.config/lxsession/LXDE-pi/autostart # Replace by "./var/run/dummy" if not needed diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml new file mode 100755 index 0000000..cc445b9 --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,48 @@ +name: Build and Push Docker images + +on: + push: + branches: + - main + paths: + - 'version.txt' + pull_request: + branches: + - main + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Read Version + id: version + run: echo "::set-output name=VERSION::$(cat version.txt)" + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + push: true + tags: jierka/obscreen:${{ steps.version.outputs.VERSION }} + platforms: linux/amd64, linux/arm64/v8, linux/arm/v7 + + - name: Create and push manifest + uses: docker/metadata-action@v3 + with: + images: jierka/obscreen + tags: type=semver,pattern={{version}} diff --git a/version.txt b/version.txt new file mode 100755 index 0000000..b123147 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +1.1 \ No newline at end of file