-
Notifications
You must be signed in to change notification settings - Fork 45
67 lines (54 loc) · 1.98 KB
/
deploy_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
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: CC-BY-4.0
name: Deploy Relay Docker Image
on:
push:
branches:
- main
paths:
- 'core/relay/VERSION'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
publish-protos-rs:
if: github.repository_owner == 'hyperledger-labs'
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]
- name: Install RUST Toolchain minimal stable with clippy and rustfmt
uses: actions-rs/[email protected]
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy
- name: Publish
run: cargo publish --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CARGO_CRATES_IO_TOKEN }}
working-directory: common/protos-rs/pkg
relay-image:
if: github.repository_owner == 'hyperledger-labs'
needs: publish-protos-rs
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Check if package already exists
run: (make check-if-tag-exists && echo "RELAY_PUSH=true" >> $GITHUB_ENV) || echo "RELAY_PUSH=false" >> $GITHUB_ENV
working-directory: core/relay
- name: Build and Push
if: ${{ env.RELAY_PUSH == 'true' }}
run: make push-server
working-directory: core/relay
- name: Push latest tag
if: ${{ env.RELAY_PUSH == 'true' }}
run: (cat out | grep "exists") || make push-server-latest
working-directory: core/relay