Skip to content

ci: setup actions

ci: setup actions #1

Workflow file for this run

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 }}