41 lines
1.4 KiB
YAML
41 lines
1.4 KiB
YAML
name: ci
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
build_linux:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout source
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Convert to lowercase
|
|
id: github_repository_to_lowercase
|
|
run: |
|
|
# Grab the value (you can also use `${{ github.ref }}`, `${{ secrets.MY_SECRET }}`, etc.)
|
|
raw_value="${{ env.MY_VAR }}"
|
|
# Convert to lower case
|
|
lower_value=$(echo "$raw_value" | tr '[:upper:]' '[:lower:]')
|
|
# Export it to the workflow environment
|
|
# echo "MY_LOWER=$lower_value" >> $GITHUB_ENV
|
|
# If you want to use it as an output of this step:
|
|
echo "lowercase=$lower_value" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build image
|
|
id: build
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: Dockerfile
|
|
# do not push yet
|
|
push: false
|
|
tags: |
|
|
${{ secrets.REGISTRY_HOST }}/${{ steps.github_repository_to_lowercase.outputs.lowercase }}:${{ github.sha }}
|
|
${{ secrets.REGISTRY_HOST }}/${{ steps.github_repository_to_lowercase.outputs.lowercase }}:${{ github.ref_name }}
|
|
${{ secrets.REGISTRY_HOST }}/${{ steps.github_repository_to_lowercase.outputs.lowercase }}:latest
|
|
build-args: |
|
|
# Add any build args here
|
|
# ARG_NAME=VALUE |