Skip to content

Commit

Permalink
ci: setup actions
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Mar 7, 2024
1 parent d8394db commit c42acd5
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 47 deletions.
47 changes: 0 additions & 47 deletions .drone.yml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: build

on:
push:
branches:
- master
schedule:
- cron: 30 22 1 * *

jobs:
build_image:
name: Build docker image
runs-on: [ ubuntu-latest ]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
thehiveproject/doc-builder
${{ secrets.harbor_registry }}/thehiveproject/doc-builder
tags: |
type=raw,value=latest,enable={{ is_default_branch }}
type=raw,value={{ date 'YYYYMMDD' }}
type=sha
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.docker_username }}
password: ${{ secrets.docker_password }}

- name: Login to Harbor
uses: docker/login-action@v2
with:
registry: ${{ secrets.harbor_registry }}
username: ${{ secrets.harbor_username }}
password: ${{ secrets.harbor_password }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Slack notification
if: always()
uses: act10ns/slack@v2
with:
webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
status: ${{ job.status }}

0 comments on commit c42acd5

Please sign in to comment.