44 lines
972 B
YAML
44 lines
972 B
YAML
name: build-image
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
env:
|
|
IMAGE: git.farh.net/farhoodlabs/intervalsicu-mcp
|
|
DOCKER_BUILDKIT: "1"
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Environment
|
|
run: |
|
|
docker version || true
|
|
df -h / || true
|
|
|
|
- name: Login to registry
|
|
run: |
|
|
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.farh.net -u cpfarhood --password-stdin
|
|
|
|
- name: Build image
|
|
run: |
|
|
docker build --progress=plain \
|
|
-t "${IMAGE}:latest" \
|
|
-t "${IMAGE}:${GITHUB_SHA}" \
|
|
.
|
|
|
|
- name: Push image
|
|
run: |
|
|
docker push "${IMAGE}:latest"
|
|
docker push "${IMAGE}:${GITHUB_SHA}"
|
|
echo "pushed ${IMAGE}:latest and ${IMAGE}:${GITHUB_SHA}"
|