-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (64 loc) · 2.35 KB
/
host-create-new-release-from-tip-of-branch.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
name: "Host: Create new release from tip of branch"
on:
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
NEW_VERSION_TAG: "overwritten-below"
IMAGE_TAGS: "overwritten-below"
jobs:
tag-and-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history so we can see all tags
path: odin-core
- name: Execute versioning script
working-directory: odin-core
run: |
output=$(./.github/scripts/increment-version-tag-on-git-tip.sh)
echo "Tagging output: $output"
echo "NEW_VERSION_TAG=${output}" >> $GITHUB_ENV
#
# Build Frontend
#
- name: Build frontend
uses: ./odin-core/.github/actions/host/build-frontend
with:
odin_lib_token: ${{ secrets.DOTYOUCORE_LIB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
#
# Build Docker image
#
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Combine Docker tags
run: |
lowercase_image_tags=$(echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.NEW_VERSION_TAG }}" | tr '[:upper:]' '[:lower:]')
echo "IMAGE_TAGS=$lowercase_image_tags" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: ./odin-core
file: ./odin-core/docker/Dockerfile-identity-host
push: true
tags: ${{ env.IMAGE_TAGS }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
provenance: false
build-args: |
VERSION_TEXT=${{ env.NEW_VERSION_TAG }}
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=homebase.id