2024-11-06 11:01:37 +01:00
|
|
|
variables:
|
|
|
|
- &docker_repo 'adoralaura/humble-bot'
|
|
|
|
- &docker_registry 'https://index.docker.io/v1/'
|
|
|
|
- &docker_username 'adoralaura'
|
|
|
|
- &docker_platforms_testing 'linux/arm64/v8,linux/amd64'
|
|
|
|
- &docker_platforms_release 'linux/arm/v7,linux/arm64/v8,linux/amd64'
|
|
|
|
- &docker_dockerfile 'Dockerfile'
|
|
|
|
|
2024-11-05 11:57:30 +01:00
|
|
|
steps:
|
2024-11-05 12:02:29 +01:00
|
|
|
- name: go-lint
|
|
|
|
image: golangci/golangci-lint
|
|
|
|
commands:
|
|
|
|
- golangci-lint run
|
|
|
|
when:
|
|
|
|
event: ["push", "pull_request", "manual"]
|
2024-11-05 12:03:32 +01:00
|
|
|
|
|
|
|
# - name: docker-deploy-push
|
|
|
|
# depends_on:
|
|
|
|
# - go-lint
|
|
|
|
# when:
|
|
|
|
# - event: push
|
|
|
|
# branch: main
|
|
|
|
# image: woodpeckerci/plugin-docker-buildx
|
|
|
|
# settings:
|
|
|
|
# dockerfile: Dockerfile
|
|
|
|
# platforms: linux/arm/v7,linux/arm64/v8,linux/amd64
|
2024-11-06 11:01:37 +01:00
|
|
|
# repo: docker_repo
|
|
|
|
# registry: *docker_registry
|
2024-11-05 12:03:32 +01:00
|
|
|
# tags: latest
|
|
|
|
# username: adoralaura
|
|
|
|
# password:
|
|
|
|
# from_secret: dockerhub_token
|
2024-11-05 11:57:30 +01:00
|
|
|
|
|
|
|
- name: docker-deploy-tag
|
|
|
|
when:
|
|
|
|
- event: tag
|
|
|
|
image: woodpeckerci/plugin-docker-buildx
|
|
|
|
settings:
|
2024-11-06 11:01:37 +01:00
|
|
|
dockerfile: *docker_dockerfile
|
|
|
|
platforms: *docker_platforms_release
|
|
|
|
repo: *docker_repo
|
|
|
|
registry: *docker_registry
|
2024-11-05 11:57:30 +01:00
|
|
|
auto_tag: true
|
2024-11-06 11:01:37 +01:00
|
|
|
username: *docker_username
|
2024-11-05 11:57:30 +01:00
|
|
|
password:
|
|
|
|
from_secret: dockerhub_token
|
|
|
|
|
|
|
|
- name: docker-deploy-unstable
|
|
|
|
depends_on:
|
2024-11-05 12:01:32 +01:00
|
|
|
- go-lint
|
2024-11-05 11:57:30 +01:00
|
|
|
when:
|
|
|
|
- event: push
|
|
|
|
branch: main
|
|
|
|
image: woodpeckerci/plugin-docker-buildx
|
|
|
|
settings:
|
2024-11-06 11:01:37 +01:00
|
|
|
dockerfile: *docker_dockerfile
|
|
|
|
platforms: *docker_platforms_testing
|
|
|
|
repo: *docker_repo
|
|
|
|
registry: *docker_registry
|
2024-11-05 11:57:30 +01:00
|
|
|
tags: unstable
|
2024-11-06 11:01:37 +01:00
|
|
|
username: *docker_username
|
|
|
|
password:
|
|
|
|
from_secret: dockerhub_token
|
|
|
|
|
|
|
|
- name: docker-deploy-pr
|
|
|
|
depends_on:
|
|
|
|
- go-lint
|
|
|
|
when:
|
|
|
|
- event: pull_request
|
|
|
|
image: woodpeckerci/plugin-docker-buildx
|
|
|
|
settings:
|
|
|
|
dockerfile: *docker_dockerfile
|
|
|
|
platforms: *docker_platforms_testing
|
|
|
|
repo: *docker_repo
|
|
|
|
registry: *docker_registry
|
|
|
|
tag: pull-${CI_COMMIT_PULL_REQUEST}
|
|
|
|
username: *docker_username
|
2024-11-05 11:57:30 +01:00
|
|
|
password:
|
|
|
|
from_secret: dockerhub_token
|