-
Notifications
You must be signed in to change notification settings - Fork 113
105 lines (95 loc) · 3.37 KB
/
release.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
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
name: Release & Devnet deploy
on:
workflow_dispatch:
inputs:
tagName:
description: 'Tag name'
required: true
releaseDescription:
description: 'Release description'
required: true
jobs:
createTag:
environment: devnet
name: Create Git tag
runs-on:
- ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create Git tag
run: |
git tag ${{ github.event.inputs.tagName }}
git push origin ${{ github.event.inputs.tagName }}
goreleaser:
environment: devnet
needs: createTag
name: GoReleaser
runs-on:
- ubuntu-latest
container:
image: iotaledger/goreleaser-cgo-cross-compiler:1.20.1
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: "refs/tags/${{github.event.inputs.tagName}}"
- run: git config --system --add safe.directory /__w/goshimmer/goshimmer
- name: Copy config.default.json to config.json
run: cp config.default.json config.json
- name: Download latest snapshot file
run: wget -O snapshot.bin https://dbfiles-goshimmer.s3.eu-central-1.amazonaws.com/snapshots/nectar/snapshot-latest.bin
- name: Run GoReleaser
run: goreleaser --clean --release-notes <(echo "${{ github.event.inputs.releaseDescription }}")
shell: bash
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
docker:
environment: devnet
needs: createTag
name: Docker build and deploy
runs-on:
- ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: "refs/tags/${{github.event.inputs.tagName}}"
- name: Publish to Docker Hub
uses: docker/build-push-action@92e71463491f2d026a477188b8ad3a0fdd9d672c
env:
DOCKER_BUILDKIT: 1
with:
repository: iotaledger/goshimmer
username: '${{ secrets.IOTALEDGER_HUB_DOCKER_LOGIN }}'
password: '${{ secrets.IOTALEDGER_HUB_DOCKER_PASSWORD }}'
tags: latest,${{github.event.inputs.tagName}}
tag_with_ref: true
- name: Install SSH Key
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
mkdir -p ~/.ssh/
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
sudo chmod 600 ~/.ssh/id_ed25519
echo '
Host *
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
' > ~/.ssh/config
- name: Ansible deploy
env:
GOSHIMMER_SEEDS: '${{ secrets.GOSHIMMER_SEEDS }}'
MONGODB_USER: '${{ secrets.MONGODB_USER }}'
MONGODB_PASSWORD: '${{ secrets.MONGODB_PASSWORD }}'
GRAFANA_ADMIN_PASSWORD: '${{ secrets.GRAFANA_ADMIN_PASSWORD }}'
ELK_ELASTIC_PASSWORD: '${{ secrets.ELK_ELASTIC_PASSWORD }}'
ELK_ELASTIC_USER: '${{ secrets.ELK_ELASTIC_USER }}'
SNAPSHOTTER_BUCKET: '${{ secrets.SNAPSHOTTER_BUCKET }}'
SNAPSHOTTER_ACCESS_KEY: '${{ secrets.SNAPSHOTTER_ACCESS_KEY }}'
SNAPSHOTTER_SECRET_KEY: '${{ secrets.SNAPSHOTTER_SECRET_KEY }}'
SLACK_NOTIFICATION_WEBHOOK: '${{ secrets.SLACK_NOTIFICATION_WEBHOOK }}'
GOSHIMMER_DOCKER_IMAGE: 'iotaledger/goshimmer'
GOSHIMMER_DOCKER_TAG: 'latest'
run: |
./deploy/ansible/run.sh devnet.yml