File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : " Build and publish Docker image"
22
33on :
4+ pull_request :
5+ paths :
6+ - payjoin-service/**
47 push :
58 tags :
69 - payjoin-service-**
710 workflow_dispatch :
811
912jobs :
10- build :
13+ publish :
1114 name : " Build and publish Docker image"
15+ if : github.event_name != 'pull_request'
1216 strategy :
1317 fail-fast : false
1418 runs-on : ubuntu-latest
3034
3135 - name : Build and release image
3236 run : nix run .#packages.x86_64-linux.payjoin-service-image.copyToRegistry
37+
38+ build-pr :
39+ name : " Build and upload image artifact"
40+ if : github.event_name == 'pull_request'
41+ strategy :
42+ fail-fast : false
43+ runs-on : ubuntu-latest
44+ permissions :
45+ contents : read
46+ packages : write
47+ steps :
48+ - name : Checkout
49+ uses : actions/checkout@v4
50+
51+ - name : Install Nix
52+ uses : DeterminateSystems/nix-installer-action@main
53+
54+ - name : Build and save image artifact
55+ run : |
56+ TAG=$(git rev-parse --short HEAD)
57+
58+ nix build .#packages.x86_64-linux.payjoin-service-image.copyToDockerDaemon
59+ result/bin/copy-to-docker-daemon
60+
61+ docker save docker.io/payjoin/payjoin-service:${TAG} -o payjoin-service-${TAG}.tar
62+
63+ echo "Image saved: payjoin-service-${TAG}.tar"
64+ ls -lh payjoin-service-${TAG}.tar
65+
66+ - name : Upload image artifact
67+ uses : actions/upload-artifact@v4
68+ with :
69+ name : payjoin-service-image-${{ github.sha }}
70+ path : payjoin-service-*.tar
71+ retention-days : 7
You can’t perform that action at this time.
0 commit comments