update-version.yml: actually prevent PR from being made on build failure #4496
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 * * *" | |
jobs: | |
build: | |
name: Build | |
strategy: | |
fail-fast: false | |
matrix: | |
cachixName: | |
- ezkea | |
nixPath: | |
- nixpkgs=channel:nixos-unstable | |
- nixpkgs=channel:nixpkgs-unstable | |
- nixpkgs=channel:nixos-23.05 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Doppler CLI | |
uses: dopplerhq/cli-action@v2 | |
- 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@v23 | |
with: | |
nix_path: "${{ matrix.nixPath }}" | |
- name: Install Cachix | |
uses: cachix/cachix-action@v12 | |
with: | |
name: ${{ matrix.cachixName }} | |
authToken: '${{ env.CACHIX_AUTH_TOKEN }}' | |
pushFilter: '(-source$|-src$|\.tar\.gz$|\.patch$)' | |
- name: Build | |
run: | | |
nix-build | |
env: | |
NIXPKGS_ALLOW_UNFREE: 1 | |
telegram: | |
name: Telegram | |
needs: build | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Install Doppler CLI | |
uses: dopplerhq/cli-action@v2 | |
- 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/[email protected] | |
- name: Send notification | |
uses: yanzay/[email protected] | |
with: | |
chat: ${{ env.NOTIFICATION_CHAT_ID }} | |
token: ${{ env.NOTIFICATION_TOKEN }} | |
status: ${{ env.WORKFLOW_CONCLUSION }} | |
if: env.WORKFLOW_CONCLUSION != 'success' |