tibber-influx/.github/workflows/docker.yml
Workflow config file is invalid. Please check your config file: yaml: unmarshal errors: line 9: cannot unmarshal !!str `ghcr.io...` into model.Job

39 lines
No EOL
1.1 KiB
YAML

name: Docker Build and Push
on:
push:
branches:
- main
- dev
jobs:
image: ghcr.io/catthehacker/ubuntu:latest
build-and-push:
runs-on: docker
steps:
- name: Login to Forgejo
uses: docker/login-action@v3
with:
registry: git.jan-ole.cloud
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Checkout code
uses: actions/checkout@v3
- name: Build and push Docker image
shell: bash
env:
DOCKER_IMAGE_NAME: tibber-influx
run: |
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
DOCKER_TAG="latest"
elif [ "${{ github.ref }}" == "refs/heads/dev" ]; then
DOCKER_TAG="development"
else
DOCKER_TAG="other"
fi
docker build -t $DOCKER_IMAGE_NAME .
docker tag $DOCKER_IMAGE_NAME:latest git.jan-ole.cloud/${{ secrets.DOCKER_USER }}/$DOCKER_IMAGE_NAME:$DOCKER_TAG
docker push git.jan-ole.cloud/${{ secrets.DOCKER_USER }}/$DOCKER_IMAGE_NAME:$DOCKER_TAG