-
-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (102 loc) · 3.5 KB
/
build.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
111
112
113
114
115
116
117
118
119
120
121
122
123
on:
push:
# branches:
# - main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ghcr.io/akdasa-studios/lectorium-gateway
IMAGE_TAG: ${{ github.sha }}
jobs:
build-gateway:
name: Build Gateway
runs-on: ubuntu-latest
environment: Staging
permissions:
contents: read
packages: write
steps:
- name: Find Latest Draft Release
id: find-release
run: |
# Fetch releases using GitHub API
response=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/releases)
# Parse the response to find the latest draft release
latest_draft=$(echo "$response" | jq -r '.[] | select(.draft == true) | .tag_name' | head -n 1)
echo "Latest draft release: $latest_draft"
echo "::set-output name=latest_draft::$latest_draft"
- name: Output Latest Draft Release
run: echo "The latest draft release is: ${{ steps.find-release.outputs.latest_draft }}"
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: ./modules/services/gateway
push: true
tags: |
ghcr.io/akdasa-studios/lectorium-gateway:${{ steps.last_release.outputs.tag_name }}-rc
# build-database:
# name: Build Database
# runs-on: ubuntu-latest
# environment: Staging
# permissions:
# contents: read
# packages: write
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# with:
# submodules: true
# - name: Setup Docker buildx
# uses: docker/setup-buildx-action@v2
# - name: Log into registry ${{ env.REGISTRY }}
# uses: docker/login-action@v2
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Build and push Docker image
# uses: docker/build-push-action@v4
# with:
# context: ./modules/services/database/modules/database
# push: true
# tags: |
# ghcr.io/akdasa-studios/lectorium-database:staging
# build-database-bootstrap:
# name: Build Database Bootstrap
# runs-on: ubuntu-latest
# environment: Staging
# permissions:
# contents: read
# packages: write
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# with:
# submodules: true
# - name: Setup Docker buildx
# uses: docker/setup-buildx-action@v2
# - name: Log into registry ${{ env.REGISTRY }}
# uses: docker/login-action@v2
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Build and push Docker image
# uses: docker/build-push-action@v4
# with:
# context: ./modules/services/database/modules/bootstrap
# push: true
# tags: |
# ghcr.io/akdasa-studios/lectorium-database-bootstrap:staging