Reviewed-on: #3 Co-authored-by: Varakh <varakh@varakh.de> Co-committed-by: Varakh <varakh@varakh.de>
This commit is contained in:
parent
951220a537
commit
0fad83cee8
3 changed files with 59 additions and 75 deletions
75
.drone.yml
75
.drone.yml
|
@ -1,75 +0,0 @@
|
|||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: build and test
|
||||
|
||||
trigger:
|
||||
event:
|
||||
include:
|
||||
- push
|
||||
steps:
|
||||
- name: test build docker image
|
||||
image: plugins/docker
|
||||
environment:
|
||||
REVISION: ${DRONE_COMMIT_SHA}
|
||||
CREATED: ${DRONE_BUILD_CREATED}
|
||||
SOURCE_URL: ${DRONE_GIT_HTTP_URL}
|
||||
settings:
|
||||
purge: true
|
||||
dry_run: true
|
||||
repo: varakh/ts3web
|
||||
username:
|
||||
from_secret: dockerhub_user
|
||||
password:
|
||||
from_secret: dockerhub_key
|
||||
tags:
|
||||
- ${DRONE_COMMIT_SHA}
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: publish
|
||||
|
||||
trigger:
|
||||
event:
|
||||
include:
|
||||
- cron
|
||||
branch:
|
||||
- master
|
||||
|
||||
steps:
|
||||
- name: publish docker image
|
||||
image: plugins/docker
|
||||
environment:
|
||||
REVISION: ${DRONE_COMMIT_SHA}
|
||||
CREATED: ${DRONE_BUILD_CREATED}
|
||||
SOURCE_URL: ${DRONE_GIT_HTTP_URL}
|
||||
settings:
|
||||
purge: true
|
||||
repo: varakh/ts3web
|
||||
username:
|
||||
from_secret: dockerhub_user
|
||||
password:
|
||||
from_secret: dockerhub_key
|
||||
tags:
|
||||
- latest
|
||||
# adapt for new releases
|
||||
- 2.2.7-SNAPSHOT
|
||||
|
||||
- name: notify about publish
|
||||
image: drillster/drone-email
|
||||
settings:
|
||||
subject: "Build failed"
|
||||
body: "URL ${DRONE_BUILD_LINK}"
|
||||
host:
|
||||
from_secret: mail_host
|
||||
username:
|
||||
from_secret: mail_user
|
||||
password:
|
||||
from_secret: mail_password
|
||||
from:
|
||||
from_secret: mail_from
|
||||
when:
|
||||
status:
|
||||
- failure
|
||||
|
29
.forgejo/workflows/build.yaml
Normal file
29
.forgejo/workflows/build.yaml
Normal file
|
@ -0,0 +1,29 @@
|
|||
on: [ push ]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: alpine:3.18
|
||||
steps:
|
||||
- name: Prepare requirements
|
||||
run: |
|
||||
apk add --no-cache nodejs npm git
|
||||
apk add --no-cache docker docker-cli-buildx
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
name: Clone
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USER }}
|
||||
password: ${{ secrets.DOCKERHUB_KEY }}
|
||||
|
||||
- name: Build docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
push: false
|
||||
tags: varakh/ts3web:${{ github.sha }}
|
30
.forgejo/workflows/release.yaml
Normal file
30
.forgejo/workflows/release.yaml
Normal file
|
@ -0,0 +1,30 @@
|
|||
on: [ release ]
|
||||
types: [ published ]
|
||||
jobs:
|
||||
release:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: alpine:3.18
|
||||
steps:
|
||||
- name: Prepare requirements
|
||||
run: |
|
||||
apk add --no-cache nodejs npm git
|
||||
apk add --no-cache docker docker-cli-buildx
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
name: Clone
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USER }}
|
||||
password: ${{ secrets.DOCKERHUB_KEY }}
|
||||
|
||||
- name: Build and push docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
push: true
|
||||
tags: varakh/ts3web:latest,varakh/ts3web:${{ github.ref_name }}
|
Reference in a new issue