Skip to content

fix(ci): set labels for self-hosted runner #71

fix(ci): set labels for self-hosted runner

fix(ci): set labels for self-hosted runner #71

Workflow file for this run

name: Release
on:
push:
branches:
- main
- beta
- gpu-runner
jobs:
build-test-release:
runs-on: [self-hosted]
steps:
- name: Define environment variables
run: echo IMAGE_NAME=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Important for Semantic Release to analyze all commits
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull container
uses: docker/build-push-action@v5
with:
tags: ${{ env.IMAGE_NAME }}:prerel
pull: true
load: true
cache-from: |
${{ env.IMAGE_NAME }}:latest
${{ env.IMAGE_NAME }}:prerel
cache-to: type=inline
- name: Build container
uses: docker/build-push-action@v5
with:
tags: ${{ env.IMAGE_NAME }}:prerel
pull: true
load: true
push: true
cache-from: |
${{ env.IMAGE_NAME }}:latest
${{ env.IMAGE_NAME }}:prerel
cache-to: type=inline
- name: Run tests
run: docker run ${{ env.IMAGE_NAME }}:prerel curl --version
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ steps.semantic.outputs.new_release_git_tag }}
- name: Build container
uses: docker/build-push-action@v5
with:
tags: |
${{ env.IMAGE_NAME }}:latest
${{ env.IMAGE_NAME }}:${{ steps.semantic.outputs.new_release_version }}
push: true
cache-from: ${{ env.IMAGE_NAME }}:prerel
cache-to: type=inline
cleanup:
runs-on: [self-hosted]
needs: build-test-release
steps:
- name: Checkout code
uses: actions/checkout@v4
- run: .github/workflows/delete_untagged.py ${{ secrets.GITHUB_TOKEN }}