1
- name : Spectre Deploy
1
+ # The Licensed Work is (c) 2022 Sygma
2
+ # SPDX-License-Identifier: LGPL-3.0-only
3
+
4
+ name : Spectre Testnet
5
+
2
6
on :
3
7
push :
4
8
branches :
5
- - main
9
+ - docker-friendly
10
+ tags :
11
+ - ' v*.*.*'
12
+
13
+ env :
14
+ REGISTRY : ' ghcr.io'
15
+ TAG : ' latest'
6
16
7
17
jobs :
8
- deploy :
18
+ push :
19
+ name : push
9
20
runs-on : ubuntu-latest
21
+
22
+ permissions :
23
+ contents : read
24
+ id-token : write
25
+
10
26
steps :
11
- - uses : actions/checkout@v4
27
+ - name : checkout the source code
28
+ uses : actions/checkout@v4
12
29
13
- - name : initialize all submodules
14
- run : git submodule update --init --recursive
15
-
16
- - name : deployments
17
-
18
- with :
19
- switches : -avzr --delete --exclude '.git'
20
- path : ./
21
- remote_path : /home/ubuntu/Spectre
22
- remote_host : ${{ secrets.ACTIONS_HOST }}
23
- remote_user : ${{ secrets.ACTIONS_USER }}
24
- remote_key : ${{ secrets.ACTIONS_CONNECTIONS }}
25
-
26
- - name : Spectre
27
-
28
- with :
29
- host : ${{ secrets.ACTIONS_HOST }}
30
- username : ${{ secrets.ACTIONS_USER }}
31
- key : ${{ secrets.ACTIONS_CONNECTIONS }}
32
- script : |
33
- sudo systemctl daemon-reload
34
- sudo systemctl restart spectre
35
-
36
- - name : slack notify
37
- uses : 8398a7/action-slack@v3
38
- with :
39
- status : ${{ job.status }}
40
- fields : repo,message,commit,author,action,job,eventName,ref,workflow
41
- env :
42
- SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
43
- if : always()
30
+ - name : Set up Docker Buildx
31
+ uses : docker/setup-buildx-action@v3
32
+
33
+ - name : login to ghcr
34
+ id : ghcr
35
+ uses : docker/login-action@v3
36
+ with :
37
+ registry : ${{ env.REGISTRY }}
38
+ username : ${{ github.repository_owner }}
39
+ password : ${{ secrets.GHCR_TOKEN }}
40
+
41
+ - name : Extract Version
42
+ run : echo "VERSION=${GITHUBREF#refs/tags/}" >> $GITHUB_ENV
43
+
44
+ - name : build / tag / push docker image into ghcr
45
+ id : build-and-push-tag
46
+ uses : docker/build-push-action@v3
47
+ with :
48
+ context : .
49
+ push : true
50
+ tags : ${{ env.REGISTRY }}/${{ github.repository }}:${{ env.TAG }},${{ env.REGISTRY }}/${{ github.repository }}:${{ env.VERSION }}
51
+
52
+ # - name: slack notify
53
+ # uses: 8398a7/action-slack@v3
54
+ # with:
55
+ # status: ${{ job.status }}
56
+ # fields: repo,message,commit,author,action,job,eventName,ref,workflow
57
+ # env:
58
+ # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
59
+ # if: always()
0 commit comments