Skip to content

chore(deps): update devdependencies-major (major) #893

chore(deps): update devdependencies-major (major)

chore(deps): update devdependencies-major (major) #893

name: Docker CI
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TILESET_NAME: trees.mbtiles
TILESET_DIR: /tilesets
TMP_DIR: /tmp
GEOJSON_OUTPUT_DIR: /tmp
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_BUCKET: ${{ secrets.AWS_TEST_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
POSTGRES_MATERIALIZE_VIEW_NAME: "vector_tiles"
GEOJSON_OUTPUT_FILENAME: "trees.geo.json"
DEFAULT_BASE_IMAGE: technologiestiftung/qtrees-vectortiles_base:latest
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_HOST: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_PORT: 5432
on:
push:
branches: [main, staging]
tags:
- "v*"
pull_request:
branches: [main, staging]
workflow_dispatch:
inputs:
debug_enabled:
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false
release:
types: [published]
jobs:
test:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- name: Checkout technologiestiftung/qtrees-vectortiles
uses: actions/checkout@v4
- name: base image test via docker compose
env:
GITHUB_TOKEN: ${{secrets.GH_PA_TOKEN}}
run: |
docker build --tag qtrees-vectortiles_base:test --file ./Dockerfile.base .
docker compose --file docker-compose.yml --file docker-compose.test.yml up --abort-on-container-exit --no-color --exit-code-from mbtileserver
- name: Tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 5
with:
limit-access-to-actor: true
test-generator:
needs:
- test
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- name: Checkout technologiestiftung/qtrees-vectortiles
uses: actions/checkout@v4
- name: Run generator using docker compose
env:
POSTGRES_HOST: ${{env.POSTGRES_HOST}}
POSTGRES_DB: ${{env.POSTGRES_DB}}
POSTGRES_USER: ${{env.POSTGRES_USER}}
POSTGRES_PASSWORD: ${{env.POSTGRES_PASSWORD}}
POSTGRES_PORT: ${{env.POSTGRES_PORT}}
TILESET_DIR: ${{env.TILESET_DIR}}
TILESET_NAME: ${{env.TILESET_NAME}}
TMP_DIR: ${{env.TMP_DIR}}
POSTGRES_MATERIALIZE_VIEW_NAME: ${{env.POSTGRES_MATERIALIZE_VIEW_NAME}}
POSTGREST_API_URL: ${{env.POSTGREST_API_URL}}
GEOJSON_OUTPUT_FILENAME: ${{env.GEOJSON_OUTPUT_FILENAME}}
GEOJSON_OUTPUT_DIR: ${{env.TMP_DIR}}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{env.AWS_DEFAULT_REGION}}
AWS_BUCKET: ${{ secrets.AWS_TEST_BUCKET }}
run: |
docker compose -f docker-compose.generator.yml up --abort-on-container-exit --no-color --exit-code-from generator
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- run: npm ci
- name: Run node tests
env:
TEST_GEOJSON_FILE_PATH: ${{env.TMP_DIR}}/${{env.GEOJSON_OUTPUT_FILENAME}}
run: npm run test:ci
- name: Tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 5
with:
limit-access-to-actor: true
release:
name: Release
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
needs:
- test
- test-generator
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install dependencies
run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: npx semantic-release
build-and-push-docker-hub:
needs:
- test
- test-generator
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Checkout source repository
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: Docker meta base
id: meta_base
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}_base
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Docker meta server
id: meta_server
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}_server
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Docker meta generator
id: meta_generator
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}_generator
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build base
uses: docker/build-push-action@v3
with:
# load: true
# platforms: linux/amd64,linux/arm64
context: .
file: ./Dockerfile.base
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta_base.outputs.tags }}
labels: ${{ steps.meta_base.outputs.labels }}
- name: Build Server
uses: docker/build-push-action@v3
with:
# load: true
# platforms: linux/amd64,linux/arm64
context: .
file: ./Dockerfile.server
build-args: |
BASE_IMAGE=${{ steps.meta_base.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta_server.outputs.tags }}
labels: ${{ steps.meta_server.outputs.labels }}
- name: Build Generator
uses: docker/build-push-action@v3
with:
# load: true
# platforms: linux/amd64,linux/arm64
context: .
file: ./Dockerfile.generator
build-args: |
BASE_IMAGE=${{ steps.meta_base.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta_generator.outputs.tags }}
labels: ${{ steps.meta_generator.outputs.labels }}
# We dont use ghcr yet. This is more like a redundanc backup
build-and-push-ghcr:
env:
REGISTRY: ghcr.io
needs:
- test
- test-generator
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
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 the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker base
id: metaghcr_base
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}_base
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Extract metadata (tags, labels) for Docker server
id: metaghcr_server
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}_server
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Extract metadata (tags, labels) for Docker generator
id: metaghcr_generator
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}_generator
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build base and push
uses: docker/build-push-action@v3
with:
# load: true
# platforms: linux/amd64,linux/arm64
context: .
file: ./Dockerfile.base
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metaghcr_base.outputs.tags }}
labels: ${{ steps.metaghcr_base.outputs.labels }}
- name: Build server and push
uses: docker/build-push-action@v3
with:
# load: true
# platforms: linux/amd64,linux/arm64
context: .
file: ./Dockerfile.server
build-args: |
BASE_IMAGE=${{ steps.metaghcr_base.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metaghcr_server.outputs.tags }}
labels: ${{ steps.metaghcr_server.outputs.labels }}
- name: Build generator and push
uses: docker/build-push-action@v3
with:
# load: true
# platforms: linux/amd64,linux/arm64
context: .
file: ./Dockerfile.generator
build-args: |
BASE_IMAGE=${{ steps.metaghcr_base.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metaghcr_generator.outputs.tags }}
labels: ${{ steps.metaghcr_generator.outputs.labels }}