48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
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
|