Some checks failed
Build and publish docker image / Builds the image and publishes to docker hub (push) Has been cancelled
Co-authored-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.tech> Reviewed-on: https://git.avroid.tech/Docker/clang-format/pulls/2
50 lines
1.2 KiB
YAML
50 lines
1.2 KiB
YAML
name: Build and publish docker image
|
|
|
|
on: [push]
|
|
|
|
env:
|
|
CI: ON
|
|
|
|
# Allow workflow to be manually run from the Gitea UI
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build_and_push:
|
|
runs-on: docker
|
|
name: Builds the image and publishes to docker hub
|
|
container:
|
|
image: harbor.avroid.tech/docker-hub-proxy/catthehacker/ubuntu:act-latest
|
|
steps:
|
|
- run: printenv
|
|
|
|
- name: Login to Harbor Docker Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: https://harbor.avroid.tech
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_TOKEN }}
|
|
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: "Build image"
|
|
run: |
|
|
make build
|
|
|
|
- name: "Push image"
|
|
run: |
|
|
make push
|
|
if: ${{ gitea.ref == 'refs/heads/master' }}
|
|
|
|
- name: "Clear image"
|
|
run: |
|
|
make clean
|
|
|
|
- name: Create and push tag
|
|
run: |
|
|
git config user.name "Jenkins"
|
|
git config user.email "svc-jenkins@avroid.tech"
|
|
git tag $(make getTag)
|
|
git push origin $(make getTag)
|
|
if: ${{ gitea.ref == 'refs/heads/master' }}
|