Skip to content

Fix trailing space in patch #12

Fix trailing space in patch

Fix trailing space in patch #12

Workflow file for this run

name: Running tests
on:
push:
# branches: [ main ]
pull_request:
jobs:
build-containers:
runs-on: ubuntu-latest
strategy:
matrix:
service:
- DIR: fody
IMAGE_NAME: fody-frontend
SUFIX: -frontend
- DIR: fody
IMAGE_NAME: fody-backend
SUFIX: -backend
- DIR: webinput-csv-new
IMAGE_NAME: webinput-csv-new-frontend
SUFIX: -frontend
- DIR: webinput-csv-new
IMAGE_NAME: webinput-csv-new-backend
SUFIX: -backend
- DIR: tools
IMAGE_NAME: tools
SUFIX: ""
permissions:
contents: read
# packages: write
defaults:
run:
working-directory: ${{ matrix.service.DIR }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
submodules: true
- name: Check service was changed in the commit
id: check-service-changed
run: |
git diff --quiet ${{ github.event.before }} ${{ github.event.after }} -- .
echo exit-code=$? >> $GITHUB_OUTPUT
shell: bash {0}
continue-on-error: true
- name: Build container
if: steps.check-service-changed.outputs.exit-code != 0
run: |
make build${{ matrix.service.SUFIX }}
# - name: Check if the current version has already been pushed
# id: check-if-pushed
# run: |
# export GHCR_TOKEN=$(echo ${{ secrets.GITHUB_TOKEN }} | base64)
# export TAG=$BASE_TAG$(cat VERSION)
# manifest=$(curl -s -H "Authorization: Bearer ${GHCR_TOKEN}" https://ghcr.io/v2/certat/$(make print)/manifests/$TAG | grep "manifest unknown")
# echo manifest=$manifest >> $GITHUB_OUTPUT
# if [ -n "$manifest" ]; then
# echo "${{ matrix.service }}" >> ../services-to-push.txt
# fi
# - name: Upload services-to-push
# if: steps.check-if-pushed.outputs.manifest
# uses: actions/upload-artifact@v4
# with:
# name: services-to-push-${{ matrix.service }}
# path: ../services-to-push.txt
# outputs:
# changed: ${{ steps.check-service-changed.outputs.exit-code }}
# gather-push-info:
# needs: build-containers
# runs-on: ubuntu-latest
# outputs:
# services: ${{ steps.collect.outputs.services }}
# steps:
# - name: Download artifact
# uses: actions/download-artifact@v4
# with:
# name: services-to-push
# - name: Collect service list
# id: collect
# run: |
# services=$(jq -R -s -c 'split("\n") | map(select(. != ""))' services-to-push.txt)
# echo "services=$services" >> $GITHUB_OUTPUT
push-images:
# needs: gather-push-info
runs-on: ubuntu-latest
# if: needs.gather-push-info.outputs.services != '[]'
environment:
name: push
permissions:
contents: read
packages: write
defaults:
run:
working-directory: ${{ matrix.service.DIR }}
strategy:
matrix:
service:
- DIR: fody
IMAGE_NAME: fody-frontend
SUFIX: -frontend
- DIR: fody
IMAGE_NAME: fody-backend
SUFIX: -backend
- DIR: webinput-csv-new
IMAGE_NAME: webinput-csv-new-frontend
SUFIX: -frontend
- DIR: webinput-csv-new
IMAGE_NAME: webinput-csv-new-backend
SUFIX: -backend
- DIR: tools
IMAGE_NAME: tools
SUFIX: ""
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
submodules: true
- name: Check if the current version has already been pushed
id: check-if-pushed
run: |
export GHCR_TOKEN=$(echo ${{ secrets.GITHUB_TOKEN }} | base64)
export TAG=$(make version${{ matrix.service.SUFIX }})
manifest=$(curl -s -H "Authorization: Bearer ${GHCR_TOKEN}" https://ghcr.io/v2/certat/$(make print${{ matrix.service.SUFIX }})/manifests/$TAG | grep "manifest unknown" || true)
echo manifest=$manifest >> $GITHUB_OUTPUT
- name: Authorize to GitHub Packages
if: steps.check-if-pushed.outputs.manifest
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Authorize to Github Docker Registry
if: steps.check-if-pushed.outputs.manifest
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Push image
if: steps.check-if-pushed.outputs.manifest
run: |
make push${{ matrix.service.SUFIX }}
env:
PUSH_REGISTRY: ghcr.io/
NAMESPACE: certat