pipeline: build: image: docker:rc-git volumes: - /var/run/docker.sock:/var/run/docker.sock environment: NAME: gitea.treehouse.systems/treehouse/mastodon 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 - docker tag $NAME:$(date -Idate -u) # maybe we can use tags someday,,, # tag-tag: # image: docker:rc-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:rc-git volumes: - /var/run/docker.sock:/var/run/docker.sock commands: - echo $REGISTRY_SECRET | docker login -u ariadne --password-stdin gitea.treehouse.systems - docker image push --all-tags gitea.treehouse.systems/treehouse/mastodon when: event: [push, tag] branch: main secrets: [REGISTRY_SECRET]