Improve run_parallel.sh #100
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Master | |
on: | |
push: | |
branches: ['master'] | |
jobs: | |
test-ts: | |
if: ${{ ! endsWith(github.event.head_commit.message, '[skip ci]') }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
package: | |
- archive | |
- common-archive-client | |
- common-data | |
- common-postgres | |
- configurator | |
- gatherer-http | |
- gatherer-stdin | |
- publisher | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: arduino/setup-task@v2 | |
with: | |
version: 3.38.0 | |
- uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: 1.1.20 | |
- run: bun install --frozen-lockfile | |
- run: task ${{ matrix.package }}:lint | |
- run: task ${{ matrix.package }}:test | |
build-base-images: | |
if: ${{ ! endsWith(github.event.head_commit.message, '[skip ci]') }} | |
needs: test-ts | |
permissions: | |
contents: write | |
packages: write | |
strategy: | |
matrix: | |
args: | |
- context: . | |
image: ghcr.io/unkhz/ruuvipuserrin-base-bun | |
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 | |
- context: ./packages/configurator | |
image: ghcr.io/unkhz/ruuvipuserrin-configurator | |
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-bun/.khz-k3s/kustomization.yaml | |
update_version_tag ./packages/archive/.khz-k3s/kustomization.yaml | |
update_version_tag ./packages/configurator/.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 }} |