-
Notifications
You must be signed in to change notification settings - Fork 9
110 lines (105 loc) · 3.07 KB
/
containerized.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
106
107
108
109
110
name: Run Tests in Container
on:
push:
branches-ignore:
- main
paths-ignore:
- CHANGELOG.md
- CONTRIBUTING.md
- LICENSE
- renovate.json
- docker-compose.yml
# - Dockerfile
workflow_dispatch:
# This should be consistent in the whole workflow
env:
YGGDRASIL_VERSION: 0.0.0
jobs:
build-app:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
container:
image: eclipse-temurin:21
env:
TERM: dumb
ports:
- "8899:8080"
- "8900:8088"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run checks and tests
run: ./gradlew # disable checks for development
# run: ./gradlew check
# - name: Upload analysis to GitHub
# uses: actions/upload-artifact@v3
# if: always()
# with:
# name: check-results
# path: |
# cartago/build/reports
# http/build/reports
# messages/build/reports
# store/build/reports
# utils/build/reports
# websub/build/reports
# build/reports
# if-no-files-found: error
- name: Make structure for app
run: cp build/libs/yggdrasil-${{ env.YGGDRASIL_VERSION }}-SNAPSHOT-all.jar .
- name: Upload app to GitHub
uses: actions/upload-artifact@v3
if: always()
with:
name: app
path: |
conf/docker_disk_config.json
yggdrasil-${{ env.YGGDRASIL_VERSION }}-SNAPSHOT-all.jar
if-no-files-found: error
# - name: Upload conf to GitHub
# uses: actions/upload-artifact@v3
# if: always()
# with:
# name: conf
# path: conf/docker_disk_config.json
# if-no-files-found: error
build-container:
needs: build-app
environment: "containerized_debugging"
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# WARNING: https://stackoverflow.com/a/57877438 is suggesting to use '@master'
# however due to change from "master" to "main", "master" is outdated
- uses: actions/download-artifact@v3
id: download
with:
# Omitting name to download all artifacts
# Skipping '/' is on purpose
path: opt/
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
build-args: |
YGGDRASIL_VERSION=${{ env.YGGDRASIL_VERSION }}
push: true
tags: galess/ics-hsg-yggdrasil:${{ env.YGGDRASIL_VERSION }}