Skip to content

Connect configurator to in-cluster archive #50

Connect configurator to in-cluster archive

Connect configurator to in-cluster archive #50

Workflow file for this run

name: Master
on:
push:
branches: ['master']
jobs:
test:
if: ${{ ! endsWith(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
strategy:
matrix:
package:
- archive
- base-node
- common-archive-client
- common-data
- common-postgres
- configurator
- gatherer-http
- gatherer-stdin
- infra-postgres
- infra-redis
- listener
- publisher
node-version: [20]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npx nx run-many --target=lint,test --projects=${{ matrix.package }} --output-style=stream
build-base-images:
if: ${{ ! endsWith(github.event.head_commit.message, '[skip ci]') }}
needs: test
permissions:
contents: write
packages: write
strategy:
matrix:
args:
- context: .
image: ghcr.io/unkhz/ruuvipuserrin-base-node
uses: ./.github/workflows/build-package.yml
with:
context: ${{ matrix.args.context }}
image: ${{ matrix.args.image }}
build-package-images:
if: ${{ ! endsWith(github.event.head_commit.message, '[skip ci]') }}
needs: build-base-images
permissions:
contents: write
packages: write
strategy:
matrix:
args:
- context: ./packages/archive
image: ghcr.io/unkhz/ruuvipuserrin-archive
uses: ./.github/workflows/build-package.yml
with:
context: ${{ matrix.args.context }}
image: ${{ matrix.args.image }}
update-version-tags:
if: ${{ ! endsWith(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
needs: build-package-images
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install yq
uses: mikefarah/yq@master
with:
cmd: yq --version
- name: Update version tags
run: |
function update_version_tag() {
file=$1
yq e '.images[0].newTag = "${{ github.sha }}"' -i $file
git add $file
}
update_version_tag ./packages/base-node/.khz-k3s/kustomization.yaml
update_version_tag ./packages/archive/.khz-k3s/kustomization.yaml
git config --global user.email "juhani.pelli@gmail.com"
git config --global user.name "Juhani Pelli"
git commit -m "Deploy ${{ github.sha }} [skip ci]"
git push origin ${{ github.event.repository.default_branch }}