-
Notifications
You must be signed in to change notification settings - Fork 4
48 lines (36 loc) · 1.29 KB
/
nix.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: CI
on:
# Triggers the workflow on push events for all branches
push:
branches: ["*"]
# Triggers the workflow on pull request events for all branches
pull_request:
branches: ["*"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: x86_64-linux
steps:
- uses: actions/checkout@v4
- uses: cachix/cachix-action@v15
with:
name: nammayatri
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
skipPush: true
- name: Build all flake outputs
run: om ci
- name: Build and push Docker image
# if: github.event.pull_request.merged == true
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker load -i $(nix build .#dockerImage --no-link --print-out-paths)
IMAGE_NAME="ghcr.io/nammayatri/beckn-gateway"
IMAGE_TAG="${GITHUB_SHA::6}"
FULL_IMAGE_NAME="${IMAGE_NAME}:${IMAGE_TAG}"
echo "$GITHUB_TOKEN" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
docker push "$FULL_IMAGE_NAME"
docker logout ghcr.io
echo "Pushed image: $FULL_IMAGE_NAME"