From d718d78210064fb103cecbcb1010f29f6e8769ce Mon Sep 17 00:00:00 2001 From: rxf Date: Sun, 31 May 2026 15:37:17 +0000 Subject: [PATCH] CI: add GitHub Actions workflow to build and push Docker image --- .github/workflows/deploy.yml | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..e11a923 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,47 @@ +name: Build and Push Docker Image + +on: + push: + branches: [ main ] + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to registry + uses: docker/login-action@v2 + with: + registry: docker.citysensor.de + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Read package version + id: ver + run: | + echo "VERSION=$(node -p \"require('./package.json').version\")" >> $GITHUB_ENV + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + push: true + platforms: linux/amd64,linux/arm64 + tags: | + docker.citysensor.de/logbuch:${{ env.VERSION }} + docker.citysensor.de/logbuch:latest + + - name: Done + run: echo "Pushed docker.citysensor.de/logbuch:${{ env.VERSION }}" + +# Secrets required in the repository settings: +# - DOCKER_USERNAME +# - DOCKER_PASSWORD