build #2156
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 | |
concurrency: build-${{ github.ref }} | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_run: | |
types: [completed] | |
workflows: | |
- update flakes | |
- update testing broker | |
- update testing demo | |
jobs: | |
build: | |
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Deploy on success | |
if: github.repository == 'portier/public-infra' && github.ref == 'refs/heads/main' | |
uses: ./.github/actions/deploy-on-success | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Prepare Nix auth | |
run: | | |
sudo mkdir -p /etc/systemd/system/nix-daemon.service.d | |
sudo tee -a /etc/systemd/system/nix-daemon.service.d/auth.conf > /dev/null << EOF | |
[Service] | |
Environment="GITHUB_TOKEN=$GITHUB_TOKEN" | |
EOF | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install Nix | |
uses: cachix/install-nix-action@V27 | |
- name: Cachix | |
uses: cachix/cachix-action@v15 | |
with: | |
name: portier | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
- name: Build | |
run: nix build -vL | |
- name: Check result | |
run: | | |
DEPLOY_STORE_PATH="$(readlink result)" | |
echo "Result: $DEPLOY_STORE_PATH" | |
# Used by deploy-on-success post step. | |
echo "DEPLOY_STORE_PATH=$DEPLOY_STORE_PATH" >> $GITHUB_ENV |