After building and pushing to Cachix, the CI now clones imphnen-infrastructure and updates its flake.lock to point to the latest frontend service commit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
62 lines
2.0 KiB
YAML
62 lines
2.0 KiB
YAML
name: Nix Build & Cache
|
|
|
|
on:
|
|
push:
|
|
branches: ['develop']
|
|
pull_request:
|
|
branches: ['develop']
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Nix
|
|
uses: DeterminateSystems/nix-installer-action@main
|
|
|
|
- name: Setup Cachix
|
|
uses: cachix/cachix-action@v15
|
|
with:
|
|
name: msdqn
|
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
|
|
|
- name: Build all packages
|
|
run: |
|
|
nix build .#landing -o result-landing
|
|
nix build .#backoffice -o result-backoffice
|
|
nix build .#gacha -o result-gacha
|
|
nix build .#dimentorin -o result-dimentorin
|
|
nix build .#hackathon -o result-hackathon
|
|
nix build .#infra -o result-infra
|
|
nix build .#qrcampaign -o result-qrcampaign
|
|
|
|
- name: Push to Cachix
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
|
|
run: |
|
|
cachix push msdqn result-landing
|
|
cachix push msdqn result-backoffice
|
|
cachix push msdqn result-gacha
|
|
cachix push msdqn result-dimentorin
|
|
cachix push msdqn result-hackathon
|
|
cachix push msdqn result-infra
|
|
cachix push msdqn result-qrcampaign
|
|
|
|
- name: Update imphnen-infrastructure flake.lock
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
|
|
env:
|
|
INFRA_DEPLOY_TOKEN: ${{ secrets.INFRA_DEPLOY_TOKEN }}
|
|
run: |
|
|
git clone https://x-access-token:${INFRA_DEPLOY_TOKEN}@github.com/IMPHNEN/imphnen-infrastructure.git /tmp/infra
|
|
cd /tmp/infra
|
|
nix flake update imphnen-frontend
|
|
if git diff --quiet flake.lock; then
|
|
echo "flake.lock unchanged, skipping"
|
|
else
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git add flake.lock
|
|
git commit -m "chore: update imphnen-frontend-service to ${GITHUB_SHA::7}"
|
|
git push
|
|
fi
|