2023-03-17 04:09:27 +00:00
|
|
|
variables:
|
|
|
|
docker-step: &docker-step
|
2022-12-28 22:27:57 +00:00
|
|
|
image: docker:rc-git
|
2022-11-12 10:55:53 +00:00
|
|
|
volumes:
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
2023-03-17 04:09:27 +00:00
|
|
|
environment:
|
|
|
|
NAME: gitea.treehouse.systems/treehouse/mastodon
|
|
|
|
pipeline:
|
|
|
|
build:
|
|
|
|
<<: *docker-step
|
2022-11-12 10:50:24 +00:00
|
|
|
commands:
|
2022-12-28 22:27:57 +00:00
|
|
|
- docker version
|
2023-03-17 04:09:27 +00:00
|
|
|
- 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:
|
|
|
|
<<: *docker-step
|
|
|
|
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
|
2022-11-12 10:50:24 +00:00
|
|
|
|
|
|
|
push:
|
2023-03-17 04:09:27 +00:00
|
|
|
<<: *docker-step
|
2022-11-12 10:50:24 +00:00
|
|
|
commands:
|
2022-11-12 11:18:48 +00:00
|
|
|
- echo $REGISTRY_SECRET | docker login -u ariadne --password-stdin gitea.treehouse.systems
|
2023-03-17 04:09:27 +00:00
|
|
|
- docker image push --all-tags $NAME
|
2022-11-12 10:50:24 +00:00
|
|
|
when:
|
|
|
|
event: [push, tag]
|
2022-11-13 03:23:58 +00:00
|
|
|
branch: main
|
2022-11-12 14:08:48 +00:00
|
|
|
secrets: [REGISTRY_SECRET]
|