-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (56 loc) · 1.9 KB
/
finish-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
name: "Finish release"
on:
push:
tags:
- "v*"
jobs:
Tagged_release:
name: "Tagged Release"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Build
run: |
make build_for_all_platforms version=${{ steps.get_version.outputs.VERSION }}
- name: Upload build artifacts to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Upload LICENSE to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: LICENSE
tag: ${{ github.ref }}
overwrite: true
Build_and_push_Docker_image:
runs-on: ubuntu-latest
needs: Tagged_release
steps:
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "Check out repository code"
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT_FOR_XDRY_VERSION_UPDATING }}
Deploy_website:
runs-on: ubuntu-latest
needs: Tagged_release
steps:
- name: Deploy website
run: |
curl -XPOST -u "${{ secrets.DEPLOY_PAT_USERNAME}}:${{secrets.DEPLOY_PAT}}" -H "Accept:application/vnd.github.everest-preview+json" -H "Content-Type:application/json" https://api.github.com/repos/leovie/xdry-website/dispatches --data '{"event_type": "deploy_website" }'