-
Notifications
You must be signed in to change notification settings - Fork 171
115 lines (102 loc) · 3.93 KB
/
docker.yaml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Docker
on:
workflow_dispatch:
inputs:
release_version:
description: "Release version"
required: true
type: string
default: ""
base_hash:
description: "Commit hash from which to build"
required: true
type: string
default: ""
publish:
description: "Publish to Docker Hub"
required: true
type: boolean
default: false
workflow_call:
inputs:
release_version:
description: "Release version"
required: true
type: string
default: ""
base_hash:
description: "Commit hash from which to build"
required: true
type: string
default: ""
publish:
description: "Publish to Docker Hub"
required: true
type: boolean
default: false
env:
IROH_FORCE_STAGING_RELAYS: "1"
jobs:
build_and_publish:
timeout-minutes: 30
name: Docker
runs-on: [self-hosted, linux, X64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Prep dirs
run: |
mkdir -p bins/linux/amd64
mkdir -p bins/linux/arm64
- name: Setup awscli on linux
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install --update
- name: Set aws credentials
run: |
echo "AWS_ACCESS_KEY_ID=${{secrets.S3_ACCESS_KEY_ID}}" >> $GITHUB_ENV
echo "AWS_SECRET_ACCESS_KEY=${{secrets.S3_ACCESS_KEY}}" >> $GITHUB_ENV
echo "AWS_DEFAULT_REGION=us-west-2" >> $GITHUB_ENV
- name: Fetch release binaries
run: |
aws s3 cp s3://vorc/iroh-linux-amd64-${{ github.event.inputs.base_hash }} bins/linux/amd64/iroh
aws s3 cp s3://vorc/iroh-relay-linux-amd64-${{ github.event.inputs.base_hash }} bins/linux/amd64/iroh-relay
aws s3 cp s3://vorc/iroh-dns-server-linux-amd64-${{ github.event.inputs.base_hash }} bins/linux/amd64/iroh-dns-server
aws s3 cp s3://vorc/iroh-linux-aarch64-${{ github.event.inputs.base_hash }} bins/linux/arm64/iroh
aws s3 cp s3://vorc/iroh-relay-linux-aarch64-${{ github.event.inputs.base_hash }} bins/linux/arm64/iroh-relay
aws s3 cp s3://vorc/iroh-dns-server-linux-aarch64-${{ github.event.inputs.base_hash }} bins/linux/arm64/iroh-dns-server
- name: Build Docker image (iroh)
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: n0computer/iroh:latest,n0computer/iroh:${{ github.event.inputs.release_version }}
target: iroh
platforms: linux/amd64,linux/arm64/v8
file: docker/Dockerfile.ci
- name: Build Docker image (iroh-relay)
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: n0computer/iroh-relay:latest,n0computer/iroh-relay:${{ github.event.inputs.release_version }}
target: iroh-relay
platforms: linux/amd64,linux/arm64/v8
file: docker/Dockerfile.ci
- name: Build Docker image (iroh-dns-server)
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: n0computer/iroh-dns-server:latest,n0computer/iroh-dns-server:${{ github.event.inputs.release_version }}
target: iroh-dns-server
platforms: linux/amd64,linux/arm64/v8
file: docker/Dockerfile.ci