CNB Exporter DEV CI #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CNB Exporter DEV CI | |
on: | |
workflow_dispatch: # Adds manual trigger | |
schedule: | |
# Runs at 05:05 UTC on the 5th day of every month | |
# ┌───────────── minute (0 - 59) | |
# │ ┌───────────── hour (0 - 23) | |
# │ │ ┌───────────── day of the month (1 - 31) | |
# │ │ │ ┌───────────── month (1 - 12) | |
# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday) | |
# │ │ │ │ │ | |
# │ │ │ │ │ | |
# * * * * * | |
- cron: '5 5 10 * *' | |
push: | |
branches: [ "dev" ] | |
paths: | |
- 'Kubernetes/cnb-prometheus-exporter/**' | |
pull_request: | |
branches: [ "dev" ] | |
paths: | |
- 'Kubernetes/cnb-prometheus-exporter/**' | |
jobs: | |
build-docker-image: | |
runs-on: self-hosted-linux | |
steps: | |
- name: Docker login | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Build docker image | |
run: cd Kubernetes/cnb-prometheus-exporter && docker build . --file Dockerfile --tag ${{ secrets.DOCKERHUB_USERNAME }}/cnb-prometheus-exporter:$(date +%s) --tag ${{ secrets.DOCKERHUB_USERNAME }}/cnb-prometheus-exporter:dev && docker push ${{ secrets.DOCKERHUB_USERNAME }}/cnb-prometheus-exporter --all-tags |