Build and populate cache #6328
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: "Build and populate cache" | |
on: | |
push: | |
branches: | |
- main | |
- release-24.11 | |
pull_request: | |
branches: | |
- main | |
- release-24.11 | |
schedule: | |
- cron: "0 */6 * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
strategy: | |
fail-fast: false | |
matrix: | |
cachixName: | |
- ezkea | |
nixpkgs: | |
- branch | |
- pinned | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Doppler CLI | |
uses: dopplerhq/cli-action@v3 | |
- name: Pass all secrets to next steps | |
run: | | |
while read -rd $'' line; do echo "$line" >> $GITHUB_ENV; done < <( doppler secrets download --no-file --format=json | jq "." | grep -v 'DOPPLER_\(CONFIG\|ENVIRONMENT\|PROJECT\)' | jq -r 'to_entries|map("\(.key)<<EOF\n\(.value)\nEOF\u0000")[]' ) | |
while read -r line; do echo "::add-mask::$line"; done < <( doppler secrets download --no-file --format=json | jq "." | grep -v 'DOPPLER_\(CONFIG\|ENVIRONMENT\|PROJECT\)' | jq -r 'to_entries|map("\(.value)\u0000")[]' ) | |
env: | |
DOPPLER_TOKEN: ${{ secrets.DOPPLER_TOKEN }} | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v30 | |
- name: Install Cachix | |
uses: cachix/cachix-action@v15 | |
with: | |
name: ${{ matrix.cachixName }} | |
authToken: '${{ env.CACHIX_AUTH_TOKEN }}' | |
pushFilter: '(-source$|-src$|\.tar\.gz$|\.patch$)' | |
- name: Build | |
run: | | |
if [[ "${{ matrix.nixpkgs }}" == "pinned" ]]; then | |
nix build --accept-flake-config -L .#allLaunchers | |
else | |
if [[ "${{github.base_ref}}" == "main" || "${{github.ref_name}}" == "main" ]]; then | |
branch="github:nixos/nixpkgs/nixos-unstable" | |
else | |
branch="github:nixos/nixpkgs/nixos-23.11" | |
fi | |
nix build \ | |
--accept-flake-config \ | |
--print-build-logs \ | |
--override-input nixpkgs "$branch" \ | |
.#allLaunchers | |
fi | |
telegram: | |
name: Telegram | |
needs: build | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Install Doppler CLI | |
uses: dopplerhq/cli-action@v3 | |
- name: Pass all secrets to next steps | |
run: | | |
while read -rd $'' line; do echo "$line" >> $GITHUB_ENV; done < <( doppler secrets download --no-file --format=json | jq "." | grep -v 'DOPPLER_\(CONFIG\|ENVIRONMENT\|PROJECT\)' | jq -r 'to_entries|map("\(.key)<<EOF\n\(.value)\nEOF\u0000")[]' ) | |
while read -r line; do echo "::add-mask::$line"; done < <( doppler secrets download --no-file --format=json | jq "." | grep -v 'DOPPLER_\(CONFIG\|ENVIRONMENT\|PROJECT\)' | jq -r 'to_entries|map("\(.value)\u0000")[]' ) | |
env: | |
DOPPLER_TOKEN: ${{ secrets.DOPPLER_TOKEN }} | |
- name: Get workflow conclusion | |
uses: technote-space/workflow-conclusion-action@v3.0 | |
- name: Send notification | |
uses: yanzay/notify-telegram@v0.1.0 | |
with: | |
chat: ${{ env.NOTIFICATION_CHAT_ID }} | |
token: ${{ env.NOTIFICATION_TOKEN }} | |
status: ${{ env.WORKFLOW_CONCLUSION }} | |
if: env.WORKFLOW_CONCLUSION != 'success' |