Skip to content

Commit

Permalink
ci: 👷 fix pipeline build
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Ruck <[email protected]>
  • Loading branch information
Manuel Ruck committed Oct 15, 2023
1 parent 9ce4939 commit b250231
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 151 deletions.
62 changes: 0 additions & 62 deletions .github/workflows/analyse-changed-packages.yaml

This file was deleted.

61 changes: 48 additions & 13 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,68 @@ on:

jobs:
analyse-changed-packages:
uses: demokratie-live/democracy-development/.github/workflows/analyse-changed-packages.yaml@feature/changelog
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.changed-packages.outputs.CHANGED }}
changedPackages: ${{ steps.changed-packages.outputs.CHANGED_PACKAGES }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

push:
- uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- run: |
SINCE=$(git rev-list --tags --max-count=1)
echo SINCE=$SINCE >> $GITHUB_OUTPUT
echo SINCE=$SINCE
id: since
- run: |
pnpm list -r --json --filter "...[$SINCE]" | jq '[.[] | select(.private == false) | {name, path}]' > ./tmp.json
CHANGED_PACKAGES=$(jq '[.[] | .name]' ./tmp.json)
echo CHANGED_PACKAGES=$CHANGED_PACKAGES >> $GITHUB_OUTPUT
echo CHANGED_PACKAGES=$CHANGED_PACKAGES
id: changed-packages
env:
SINCE: ${{ steps.since.outputs.SINCE }}
build-and-push:
runs-on: ubuntu-latest
environment: docker
needs: [analyse-changed-packages]
if: ${{ needs.analyse-changed-packages.outputs.changed != '[]' && needs.analyse-changed-packages.outputs.changed != '' }}
if: ${{ needs.analyse-changed-packages.outputs.changedPackages != '[]'}}
strategy:
fail-fast: false
matrix:
package: ${{fromJson(needs.analyse-changed-packages.outputs.changed)}}
package: ${{fromJson(needs.analyse-changed-packages.outputs.changedPackages)}}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- run: echo "package=${{ matrix.package }}"
- name: get directory for package
id: get-directory
run: |
# Variablen setzen
matrix_package="${{ matrix.package }}"
changed_packages_json='${{ needs.analyse-changed-packages.outputs.changedPackages }}'
# Verzeichnis mit jq finden
directory=$(echo "$changed_packages_json" | jq -r --arg package "$matrix_package" '.[] | select(.package == $package) | .directory')
directory=$(pnpm ls -r --json --filter $MATRIX_PACKAGE | jq -r '.[0] | .path')
directory="${directory##*/democracy-development/}"
# Ausgabe
echo "$directory"
echo "directory=$directory" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v4
env:
MATRIX_PACKAGE: ${{ matrix.package }}

- run: echo "directory=${{ steps.get-directory.outputs.directory }}"

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
Expand Down
75 changes: 0 additions & 75 deletions .github/workflows/release-please.yaml

This file was deleted.

7 changes: 6 additions & 1 deletion infra/Dockerfile.service
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
ARG NODE_VERSION

FROM node:${NODE_VERSION}-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
ARG SERVICE
ARG SERVICE_PATH
ENV SERVICE_PATH ${SERVICE_PATH}
RUN corepack enable
RUN pnpm install turbo --global

FROM base AS builder
RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory
WORKDIR /app
RUN pnpm global add turbo

COPY . .
RUN turbo prune --scope=$SERVICE --docker

Expand Down Expand Up @@ -42,6 +46,7 @@ USER runuser

COPY --from=installer /app/$SERVICE_PATH/package.json .
COPY --from=installer /app/node_modules ./node_modules
RUN echo "COPY --from=installer --chown=runuser:nodejs /app/$SERVICE_PATH/build ./build"
COPY --from=installer --chown=runuser:nodejs /app/$SERVICE_PATH/build ./build

CMD pnpm --cwd $SERVICE_PATH start
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"dependencies": {
"@democracy-deutschland/bundestag.io-definitions": "^1.0.2",
"@democracy-deutschland/bundestagio-common": "0.1.16",
"@democracy-deutschland/scapacra": "^1.0.6",
"@democracy-deutschland/scapacra-bt": "^1.0.31",
"http2": "^3.3.7"
},
Expand Down
1 change: 1 addition & 0 deletions services/cron-jobs/import-named-poll-deputies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"dependencies": {
"@democracy-deutschland/bundestag.io-definitions": "^1.0.2",
"@democracy-deutschland/bundestagio-common": "0.1.16",
"@democracy-deutschland/scapacra": "^1.0.6",
"@democracy-deutschland/scapacra-bt": "1.0.32",
"http2": "^3.3.7"
},
Expand Down

0 comments on commit b250231

Please sign in to comment.