-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (66 loc) · 2.5 KB
/
test_relay_server.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
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
name: Deploy Test Relay Server
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * *'
concurrency:
group: relay-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
RUST_BACKTRACE: 1
RUSTFLAGS: -Dwarnings
RUSTDOCFLAGS: -Dwarnings
MSRV: "1.76"
SCCACHE_CACHE_SIZE: "50G"
IROH_FORCE_STAGING_RELAYS: "1"
jobs:
build_relay_server:
runs-on: [self-hosted, linux, X64]
if: github.ref_name=='main'
env:
# Using self-hosted runners so use local cache for sccache and
# not SCCACHE_GHA_ENABLED.
RUSTC_WRAPPER: "sccache"
RUST_BACKTRACE: full
RUSTV: stable
steps:
- uses: actions/checkout@v4
- name: Install rust stable
uses: dtolnay/rust-toolchain@stable
- name: Install sccache
uses: mozilla-actions/[email protected]
- name: build release
run: |
cargo build --release --all-features --bin iroh-relay
- 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: push release
run: |
aws s3 cp ./target/release/iroh-relay s3://vorc/iroh-relay-linux-amd64-${GITHUB_SHA::7} --no-progress
- name: Set iroh-relay tag
id: set_tag
run: |
echo ::set-output name=tag::${GITHUB_SHA::7}
deploy_iroh-relay:
runs-on: ubuntu-latest
if: github.ref_name=='main'
needs: build_relay_server
steps:
- uses: actions/checkout@v4
- name: Run Staging Deploy Playbook
uses: arqu/action-ansible-playbook@master
with:
playbook: redeploy-relay.yml
directory: .github/ansible
key: ${{ secrets.TEST_DERPER_SSH_PKEY }}
inventory: ${{ secrets.TEST_DERPER_INVENTORY }}
known_hosts: ${{ secrets.TEST_DERPER_KNOWN_HOSTS }}
options: --extra-vars ansible_ssh_user=root --extra-vars relay_version=${{ needs.build_relay_server.outputs.set_tag.tag }}