esl-docker/.forgejo/workflows/publish-docker.yml

37 lines
1.0 KiB
YAML
Raw Permalink Normal View History

name: Publish Docker image
on:
push:
branches:
- 'main'
jobs:
push_to_registry:
name: Push Docker image to local registry
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
submodules: recursive
- name: setup buildx
uses: https://github.com/docker/setup-buildx-action@v2
- name: Log in to local registry
run: |
BASE64_AUTH=`echo -n "$CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD" | base64`
mkdir -p ~/.docker
echo "{\"auths\": {\"$CI_REGISTRY\": {\"auth\": \"$BASE64_AUTH\"}}}" > ~/.docker/config.json
env:
CI_REGISTRY: https://git.kallestruik.nl
CI_REGISTRY_USER: ${{ secrets.FORGEJO_USERNAME }}
CI_REGISTRY_PASSWORD: ${{ secrets.FORGEJO_PASSWORD }}
- name: Build and push Docker image
uses: https://github.com/docker/build-push-action@v4
with:
context: .
push: true
tags: "git.kallestruik.nl/kalle/esl-docker:latest"