Host: Create new release from tip of branch #254
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |