33 lines
761 B
YAML
33 lines
761 B
YAML
|
name: Build Docker image and publish
|
||
|
|
||
|
on: [push]
|
||
|
|
||
|
env:
|
||
|
DOCKER_REPOSITORY: "git.flifloo.fr"
|
||
|
DOCKER_TAG: "$DOCKER_REPOSITORY/$GITHUB_REPOSITORY:latest"
|
||
|
|
||
|
jobs:
|
||
|
docker:
|
||
|
runs-on: docker
|
||
|
container:
|
||
|
image: docker:stable
|
||
|
|
||
|
services:
|
||
|
dind:
|
||
|
image: docker:stable-dind
|
||
|
options: "--privileged"
|
||
|
cmd: [ "dockerd", "-H", "tcp://0.0.0.0:2375", "--tls=false" ]
|
||
|
|
||
|
steps:
|
||
|
- name: "Login to Docker repository"
|
||
|
id: login
|
||
|
run: "docker login -u $GITHUB_REPOSITORY_OWNER -p $GITHUB_TOKEN $DOCKER_REPOSITORY"
|
||
|
|
||
|
- name: "Build Docker image"
|
||
|
id: build
|
||
|
run: "docker buildx build -t $DOCKER_TAG ."
|
||
|
|
||
|
- name: "Publish Docker image"
|
||
|
id: push
|
||
|
run: "docker push $DOCKER_TAG"
|