mastodon/.woodpecker.yml

55 lines
1.4 KiB
YAML

variables:
image: &docker-git docker:rc-git
volumes: &docker.sock
- /var/run/docker.sock:/var/run/docker.sock
environment:
common: &common-env
NAME: gitea.treehouse.systems/treehouse/mastodon
docker-step: &docker-step
image: docker:rc-git
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
NAME: gitea.treehouse.systems/treehouse/mastodon
pipeline:
build:
image: *docker-git
volumes: *docker.sock
environment:
<<: *common-env
commands:
- docker version
- docker image build -f Dockerfile --build-arg SOURCE_TAG=$CI_COMMIT_SHA . -t $NAME:latest
- docker tag $NAME:latest $NAME:$CI_COMMIT_SHA
tag-nightly:
image: *docker-git
volumes: *docker.sock
environment:
<<: *common-env
commands:
- docker tag $NAME:latest $NAME:$(date -Idate -u)
# maybe we can use tags someday,,,
# tag-tag:
# image: *docker-git
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# commands:
# - docker tag $NAME:latest $NAME:$CI_COMMIT_TAG
# when:
# event: tag
push:
image: *docker-git
volumes: *docker.sock
environment:
<<: *common-env
commands:
- echo $REGISTRY_SECRET | docker login -u ariadne --password-stdin gitea.treehouse.systems
- docker image push --all-tags $NAME
when:
event: [push, tag]
branch: main
secrets: [REGISTRY_SECRET]