-
Notifications
You must be signed in to change notification settings - Fork 12
executable file
·89 lines (78 loc) · 2.31 KB
/
workflow.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
name: workflow
on: push
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- macos-latest
runs-on: ${{ matrix.os }}
steps:
# setup repository
- name: Checkout
uses: actions/checkout@v2
# install dependencies
- name: Run build
run: .github/scripts/build.sh
shell: bash
# build documentation
- name: Documentation
run: .github/scripts/documentation.sh
shell: bash
# upload artifacts
- uses: actions/upload-artifact@v2
with:
name: imitator-${{ matrix.os }}
path: |
bin/*
doc/IMITATOR-user-manual.pdf
doc/IMITATOR-not-developer-manual.pdf
deploy:
if: startsWith(github.ref, 'refs/tags/')
name: Publish - Github Release
runs-on: ubuntu-22.04
needs: build
steps:
# retrieve information
- name: Retrieve artifacts
uses: actions/download-artifact@v2
# deploy
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
files: |
imitator-macos-*/bin/*
imitator-ubuntu-*/bin/*
imitator-ubuntu-*/doc/IMITATOR-user-manual.pdf
imitator-ubuntu-*/doc/IMITATOR-not-developer-manual.pdf
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker:
if: startsWith(github.ref, 'refs/tags/') || (github.ref == 'refs/heads/develop')
name: Publish - Docker Hub
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: imitator/imitator
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}