umami/.github/workflows/cd.yml

60 lines
2.2 KiB
YAML
Raw Normal View History

name: Create docker images
2022-06-27 11:01:15 +02:00
on: [create]
env:
# set Docker OCI Labels
DOCKER_LABELS: >
org.opencontainers.image.title=${{github.event.repository.name}},
org.opencontainers.image.description="Umami is a simple, fast, privacy-focused alternative to Google Analytics",
org.opencontainers.image.vendor=${{github.repository_owner}},
org.opencontainers.image.licenses="MIT",
org.opencontainers.image.version=${{github.ref_name}},
org.opencontainers.image.source=${{github.server_url}}/${{github.repository}},
org.opencontainers.image.revision=${{github.sha}},
org.opencontainers.image.url="https://umami.is/",
org.opencontainers.image.documentation="https://umami.is/docs",
org.opencontainers.image.base.name="docker.io/library/node:18-alpine"
jobs:
build:
name: Build, push, and deploy
2022-06-27 11:01:15 +02:00
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
strategy:
matrix:
db-type: [postgresql, mysql]
steps:
2023-04-20 01:20:45 +02:00
- uses: actions/checkout@v3
2022-06-27 11:01:15 +02:00
- name: Set env
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "NOW=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
2022-06-27 11:01:15 +02:00
2023-03-12 18:06:06 +01:00
- uses: mr-smithers-excellent/docker-build-push@v6
2023-08-03 19:55:30 +02:00
name: Build & push Docker image to ghcr.io for ${{ matrix.db-type }}
2022-06-24 11:27:08 +02:00
with:
image: umami
2022-06-27 11:01:15 +02:00
tags: ${{ matrix.db-type }}-${{ env.RELEASE_VERSION }}, ${{ matrix.db-type }}-latest
labels: $DOCKER_LABELS
2022-06-24 11:27:08 +02:00
buildArgs: DATABASE_TYPE=${{ matrix.db-type }}
2022-06-30 19:31:01 +02:00
registry: ghcr.io
2023-03-12 18:06:06 +01:00
multiPlatform: true
platform: linux/amd64,linux/arm64
2022-06-24 11:27:08 +02:00
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
2023-08-03 19:55:30 +02:00
2023-08-03 19:55:30 +02:00
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build & push Docker image to docker.io for ${{ matrix.db-type }}
with:
image: umamisoftware/umami
tags: ${{ matrix.db-type }}-${{ env.RELEASE_VERSION }}, ${{ matrix.db-type }}-latest
labels: $DOCKER_LABELS
2023-08-03 19:55:30 +02:00
buildArgs: DATABASE_TYPE=${{ matrix.db-type }}
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}