49 lines
1.7 KiB
YAML
49 lines
1.7 KiB
YAML
name: CD
|
|
|
|
on:
|
|
push:
|
|
branches: ["master"]
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Checkout repo
|
|
uses: https://github.com/actions/checkout@v4
|
|
with:
|
|
repository: '4o1x5/producer-consumer'
|
|
ref: 'master'
|
|
token: '${{ secrets.GIT_TOKEN }}'
|
|
-
|
|
name: Set up QEMU for docker
|
|
uses: https://github.com/docker/setup-qemu-action@v3
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: https://github.com/docker/setup-buildx-action@v3
|
|
|
|
-
|
|
name: Set up nix cachix
|
|
uses: https://github.com/DeterminateSystems/magic-nix-cache-action@main
|
|
-
|
|
name: Login to git.4o1x5.dev container registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: git.4o1x5.dev
|
|
username: ${{ secrets.GIT_USERNAME }}
|
|
password: ${{ secrets.GIT_TOKEN }}
|
|
|
|
-
|
|
name: Setup nix for building
|
|
uses: https://github.com/cachix/install-nix-action@v27
|
|
with:
|
|
# add kvm support
|
|
extra_nix_config: |
|
|
system-features = nixos-test benchmark big-parallel kvm
|
|
-
|
|
name: Build, import, tag and push producer container
|
|
run: nix build .#producer-container && docker image load --input result && docker image tag producer:latest git.4o1x5.dev/4o1x5/producer:latest && docker image push git.4o1x5.dev/4o1x5/producer:latest
|
|
|
|
-
|
|
name: Build, import, tag and push consumer container
|
|
run: nix build .#consumer-container && docker image load --input result && docker image tag consumer:latest git.4o1x5.dev/4o1x5/consumer:latest && docker image push git.4o1x5.dev/4o1x5/consumer:latest |