Skip to content

Commit 9a9dd16

Browse files
Merge pull request #1 from FullStackS-GmbH/task/workflow
Task/workflow
2 parents f2fd8b2 + e59990d commit 9a9dd16

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Universal Airgapper
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
job-name:
7+
description: 'Job Name'
8+
default: 'airgapper'
9+
required: false
10+
image_registry:
11+
description: 'Registry of the image to use'
12+
default: 'ghcr.io'
13+
required: false
14+
image_name:
15+
description: 'Name of the image'
16+
default: 'fullstacks-gmbh/universal-airgapper'
17+
required: false
18+
image_tag:
19+
description: 'Tag of the image'
20+
default: '0.0.10'
21+
required: false
22+
image_pull_policy:
23+
description: 'Image pull policy'
24+
default: 'always'
25+
required: false
26+
config-folder:
27+
description: '--config-folder parameter; path to folder, containing config files'
28+
default: '${{ github.workspace }}'
29+
required: false
30+
debug:
31+
description: 'Enable debug mode'
32+
default: ''
33+
required: false
34+
credentials-secret-name:
35+
description: 'Name of the secret containing the credentials'
36+
default: 'UNIVERSAL_AIRGAPPER_CREDS'
37+
required: false
38+
39+
jobs:
40+
airgapper:
41+
name: ${{ github.event.inputs.job-name || 'airgapper' }}
42+
runs-on: ubuntu-latest
43+
container:
44+
image: ${{ github.event.inputs.image_registry || 'registry.lab.cloudstacks.eu' }}/${{ github.event.inputs.image_name || 'fullstacks-tools/universal-airgapper' }}:${{ github.event.inputs.image_tag || 'latest' }}
45+
options: --pull=${{ github.event.inputs.image_pull_policy || 'always' }}
46+
steps:
47+
- name: Checkout repository
48+
uses: actions/checkout@v4
49+
50+
- name: Show config files
51+
run: |
52+
echo "========================================================"
53+
echo "================ Universal Airgapper [ $APP_VERSION ] ============"
54+
echo "================ Commit - $APP_COMMIT_SHA ==================="
55+
echo "====================== CONFIG =========================="
56+
cat ${{ github.event.inputs.config-folder || github.workspace }}/*.yaml || true
57+
echo "========================================================"
58+
59+
- name: Write credentials file
60+
run: echo "${{ secrets[github.event.inputs.credentials-secret-name] }}" > credentials.yaml
61+
62+
- name: Run Universal Airgapper
63+
run: |
64+
python /home/airgapper/main.py \
65+
--credentials-file "${{ github.event.inputs.credentials-file || secrets.UNIVERSAL_AIRGAPPER_CREDS }}" \
66+
--config-folder "${{ github.event.inputs.config-folder || github.workspace }}" ${{ github.event.inputs.debug }}

0 commit comments

Comments
 (0)