Build and populate cache #5052
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] | |
pull_request: | |
branches: [main] | |
schedule: | |
- cron: "0 */6 * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
strategy: | |
fail-fast: false | |
matrix: | |
cachixName: | |
- ezkea | |
nixpkgs: | |
- nixos-unstable | |
# - nixpkgs-unstable | |
- nixos-23.11 | |
- 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@v26 | |
- name: Install Cachix | |
uses: cachix/cachix-action@v14 | |
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 | |
nix build \ | |
--accept-flake-config \ | |
--print-build-logs \ | |
--override-input nixpkgs "github:NixOS/nixpkgs/${{ matrix.nixpkgs }}" \ | |
.#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' |