Skip to content

Add CD workflow

Add CD workflow #7

Workflow file for this run

name: CD Release Pipeline
concurrency:
group: cd-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: ["add-cd"]
tags:
- "*/*"
jobs:
extract-version:
name: "Extract target and version"
runs-on: ubuntu-latest
outputs:
target: ${{ steps.extract.outputs.target }}
major: ${{ steps.extract.outputs.major }}
minor: ${{ steps.extract.outputs.minor }}
patch: ${{ steps.extract.outputs.patch }}
steps:
- name: Set $USER if needed
run: |
if [ -z "$USER" ]; then
echo "USER=runner" >> "$GITHUB_ENV"
fi
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-23.11
- uses: cachix/cachix-action@v14
with:
name: apibara-public
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- id: extract
run: nix develop .#ci --accept-flake-config -c extract-version-from-tag
build-artifacts:
name: "Build artifacts ${{ needs.extract-version.outputs.target }}"
needs: extract-version
uses: ./.github/workflows/cd-build.yml
if: ${{ needs.extract-version.outputs.target != '' }}
with:
target: ${{ needs.extract-version.outputs.target }}
secrets:
cachix-token: "${{ secrets.CACHIX_AUTH_TOKEN }}"