50 lines
1.4 KiB
YAML
50 lines
1.4 KiB
YAML
name: Build OCI Image
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: main
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
# list of Docker images to use as base name for tags
|
|
images: |
|
|
harbor.yadunut.dev/yadunut/yadunut.dev
|
|
# generate Docker tags based on the following events/attributes
|
|
tags: |
|
|
type=sha
|
|
type=ref,event=branch
|
|
|
|
# - name: Login to Harbor
|
|
# uses: docker/login-action@v3
|
|
# with:
|
|
# registry: harbor.yadunut.dev
|
|
# username: ${{ secrets.HARBOR_USERNAME }}
|
|
# password: ${{ secrets.HARBOR_PASSWORD }}
|
|
- name: Set up Docker Context for Buildx
|
|
id: buildx-context
|
|
run: |
|
|
export DOCKER_HOST=tcp://docker:2376/
|
|
export DOCKER_TLS_CERTDIR="/certs"
|
|
export DOCKER_TLS_VERIFY=1
|
|
export DOCKER_CERT_PATH="/certs/client"
|
|
docker context create builders
|
|
|
|
- name: Setup Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
# with:
|
|
# endpoint: builders
|
|
# - name: Build and push
|
|
# uses: docker/build-push-action@v6
|
|
# with:
|
|
# push: true
|
|
# tags: ${{ steps.meta.outputs.tags }}
|
|
# labels: ${{ steps.meta.outputs.labels }}
|