1+ name : Docker
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ release_version :
7+ description : " Release version"
8+ required : true
9+ type : string
10+ default : " "
11+ base_hash :
12+ description : " Commit hash from which to build"
13+ required : true
14+ type : string
15+ default : " "
16+ publish :
17+ description : " Publish to Docker Hub"
18+ required : true
19+ type : boolean
20+ default : false
21+ workflow_call :
22+ inputs :
23+ release_version :
24+ description : " Release version"
25+ required : true
26+ type : string
27+ default : " "
28+ base_hash :
29+ description : " Commit hash from which to build"
30+ required : true
31+ type : string
32+ default : " "
33+ publish :
34+ description : " Publish to Docker Hub"
35+ required : true
36+ type : boolean
37+ default : false
38+
39+ env :
40+ IROH_FORCE_STAGING_RELAYS : " 1"
41+
42+ jobs :
43+ build_and_publish :
44+ timeout-minutes : 30
45+ name : Docker
46+ runs-on : [self-hosted, linux, X64]
47+ steps :
48+ - name : Checkout
49+ uses : actions/checkout@v4
50+
51+ - name : Set up Docker Buildx
52+ uses : docker/setup-buildx-action@v3
53+
54+ - name : Login to Docker Hub
55+ uses : docker/login-action@v3
56+ with :
57+ username : ${{ secrets.DOCKERHUB_USERNAME }}
58+ password : ${{ secrets.DOCKERHUB_TOKEN }}
59+
60+ - name : Prep dirs
61+ run : |
62+ mkdir -p bins/linux/amd64
63+ mkdir -p bins/linux/arm64
64+
65+ - name : Setup awscli on linux
66+ run : |
67+ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
68+ unzip awscliv2.zip
69+ sudo ./aws/install --update
70+
71+ - name : Set aws credentials
72+ run : |
73+ echo "AWS_ACCESS_KEY_ID=${{secrets.S3_ACCESS_KEY_ID}}" >> $GITHUB_ENV
74+ echo "AWS_SECRET_ACCESS_KEY=${{secrets.S3_ACCESS_KEY}}" >> $GITHUB_ENV
75+ echo "AWS_DEFAULT_REGION=us-west-2" >> $GITHUB_ENV
76+
77+ - name : Fetch release binaries
78+ run : |
79+ aws s3 cp s3://vorc/iroh-relay-linux-amd64-${{ inputs.base_hash }} bins/linux/amd64/iroh-relay
80+ aws s3 cp s3://vorc/iroh-dns-server-linux-amd64-${{ inputs.base_hash }} bins/linux/amd64/iroh-dns-server
81+
82+ aws s3 cp s3://vorc/iroh-relay-linux-aarch64-${{ inputs.base_hash }} bins/linux/arm64/iroh-relay
83+ aws s3 cp s3://vorc/iroh-dns-server-linux-aarch64-${{ inputs.base_hash }} bins/linux/arm64/iroh-dns-server
84+
85+ - name : Build Docker image (iroh-relay)
86+ uses : docker/build-push-action@v6
87+ with :
88+ context : .
89+ push : ${{ inputs.publish }}
90+ tags : n0computer/iroh-relay:latest,n0computer/iroh-relay:${{ inputs.release_version }}
91+ target : iroh-relay
92+ platforms : linux/amd64,linux/arm64/v8
93+ file : docker/Dockerfile.ci
94+
95+ - name : Build Docker image (iroh-dns-server)
96+ uses : docker/build-push-action@v6
97+ with :
98+ context : .
99+ push : ${{ inputs.publish }}
100+ tags : n0computer/iroh-dns-server:latest,n0computer/iroh-dns-server:${{ inputs.release_version }}
101+ target : iroh-dns-server
102+ platforms : linux/amd64,linux/arm64/v8
103+ file : docker/Dockerfile.ci
0 commit comments