refactor: drop drone ci
Diff
.drone.yml | 239 +------------------------------------
.github/workflows/release.docker.yml | 73 +++++++++++-
2 files changed, 73 insertions(+), 239 deletions(-)
@@ -1,239 +0,0 @@
---
kind: pipeline
type: docker
name: development
platform:
os: linux
arch: amd64
steps:
- name: test
image: joseluisq/rust-linux-darwin-builder:1.56.0
volumes:
- name: cargo-target
path: /drone/src/target
- name: cargo-git
path: /root/.cargo/git
- name: cargo-registry
path: /root/.cargo/registry
commands:
- make test
volumes:
- name: cargo-target
host:
path: /var/ci-volumes/cargo-target
- name: cargo-git
host:
path: /var/ci-volumes/cargo-git
- name: cargo-registry
host:
path: /var/ci-volumes/cargo-registry
trigger:
event:
- push
- pull_request
branch:
- master
- develop
- feature/*
- bugfix/*
- hotfix/*
---
kind: pipeline
type: docker
name: production
platform:
os: linux
arch: amd64
steps:
- name: publish-public-alpine
image: joseluisq/drone-docker
privileged: true
settings:
repo: joseluisq/static-web-server
dockerfile: ./docker/alpine/Dockerfile
username:
from_secret: dockerhub_username
password:
from_secret: dockerhub_password
build_args:
- SERVER_VERSION=${DRONE_TAG##v}
auto_tag: true
auto_tag_suffix: alpine
- name: publish-public-scratch
image: joseluisq/drone-docker
privileged: true
settings:
repo: joseluisq/static-web-server
dockerfile: ./docker/scratch/Dockerfile
username:
from_secret: dockerhub_username
password:
from_secret: dockerhub_password
build_args:
- SERVER_VERSION=${DRONE_TAG##v}
auto_tag: true
auto_tag_aliases:
- latest
- name: publish-alpine
image: joseluisq/drone-docker
privileged: true
settings:
registry: registry.joseluisq.net
repo: registry.joseluisq.net/static-web-server
dockerfile: ./docker/alpine/Dockerfile
username:
from_secret: registry_username
password:
from_secret: registry_password
build_args:
- SERVER_VERSION=${DRONE_TAG##v}
auto_tag: true
auto_tag_suffix: alpine
- name: publish-scratch
image: joseluisq/drone-docker
privileged: true
settings:
registry: registry.joseluisq.net
repo: registry.joseluisq.net/static-web-server
dockerfile: ./docker/scratch/Dockerfile
username:
from_secret: registry_username
password:
from_secret: registry_password
build_args:
- SERVER_VERSION=${DRONE_TAG##v}
auto_tag: true
auto_tag_aliases:
- latest
trigger:
ref:
include:
- refs/tags/v*
exclude:
- refs/tags/**rc**
- refs/tags/**alpha**
- refs/tags/**beta**
- refs/tags/**latest**
- refs/tags/**dev**
---
kind: pipeline
type: docker
name: production-beta
platform:
os: linux
arch: amd64
steps:
- name: publish-public-alpine
image: joseluisq/drone-docker
privileged: true
settings:
repo: joseluisq/static-web-server
dockerfile: ./docker/alpine/Dockerfile
username:
from_secret: dockerhub_username
password:
from_secret: dockerhub_password
build_args:
- SERVER_VERSION=${DRONE_TAG##v}
auto_tag: true
auto_tag_suffix: alpine
- name: publish-public-scratch
image: joseluisq/drone-docker
privileged: true
settings:
repo: joseluisq/static-web-server
dockerfile: ./docker/scratch/Dockerfile
username:
from_secret: dockerhub_username
password:
from_secret: dockerhub_password
build_args:
- SERVER_VERSION=${DRONE_TAG##v}
auto_tag: true
- name: publish-alpine
image: joseluisq/drone-docker
privileged: true
settings:
registry: registry.joseluisq.net
repo: registry.joseluisq.net/static-web-server
dockerfile: ./docker/alpine/Dockerfile
username:
from_secret: registry_username
password:
from_secret: registry_password
build_args:
- SERVER_VERSION=${DRONE_TAG##v}
auto_tag: true
auto_tag_suffix: alpine
- name: publish-scratch
image: joseluisq/drone-docker
privileged: true
settings:
registry: registry.joseluisq.net
repo: registry.joseluisq.net/static-web-server
dockerfile: ./docker/scratch/Dockerfile
username:
from_secret: registry_username
password:
from_secret: registry_password
build_args:
- SERVER_VERSION=${DRONE_TAG##v}
auto_tag: true
trigger:
ref:
include:
- refs/tags/**beta**
---
kind: pipeline
type: docker
name: notification
platform:
os: linux
arch: amd64
clone:
disable: true
steps:
- name: notify
image: plugins/slack
settings:
webhook:
from_secret: slack_webhook
channel: ci-cd
depends_on:
- development
- production
- production-beta
trigger:
status:
- success
- failure
@@ -0,0 +1,73 @@
name: release
on:
release:
types: published
jobs:
docker-image:
runs-on: ${{ matrix.os }}
if: startsWith(github.ref, 'v2')
strategy:
matrix:
build:
- scratch
- alpine
include:
- build: scratch
os: ubuntu-20.04
- build: alpine
os: ubuntu-20.04
steps:
-
name: Checkout repository
uses: actions/checkout@v2
-
name: Docker meta scratch
id: meta
if: matrix.build == 'scratch'
uses: docker/metadata-action@v3
with:
images: joseluisq/static-web-server
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
-
name: Docker meta alpine
id: meta
uses: docker/metadata-action@v3
if: matrix.build == 'alpine'
with:
images: joseluisq/static-web-server
flavor: |
latest=false
suffix=alpine
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Prepare Docker envs
shell: bash
run: |
echo "SERVER_VERSION=${GITHUB_REF##v}" >> $GITHUB_ENV
echo "SERVER_DOCKERFILE=./docker/${{ matrix.build }}/Dockerfile" >> $GITHUB_ENV
-
name: Build and push
uses: docker/build-push-action@v2
with:
push: true
context: .
file: ${{ env.SERVER_DOCKERFILE }}
tags: ${{ steps.meta.outputs.tags }}
build-args: |
SERVER_VERSION=${{ env.SERVER_VERSION }}