init
This commit is contained in:
37
gitea/workflows/docker-build.yml
Normal file
37
gitea/workflows/docker-build.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
name: build container icinga2
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'Dockerfile'
|
||||
- 'init.sh'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./icinga2
|
||||
|
||||
env:
|
||||
REGISTRY_HOST: git.ao-it.net
|
||||
CONTAINER_TAG: ${{ gitea.repository }}
|
||||
CONTAINER_VERSION: latest
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: test
|
||||
steps:
|
||||
- name: clone repo
|
||||
working-directory: ${{ gitea.workspace }}
|
||||
run: git clone https://$TOKEN@${{ vars.AOIT_GIT_URL }}/${{ gitea.repository }}
|
||||
env:
|
||||
TOKEN: ${{ secrets.SERVICE_USER_TOKEN }}
|
||||
- name: docker build
|
||||
run: docker build -t $REGISTRY_HOST/$CONTAINER_TAG:$CONTAINER_VERSION .
|
||||
- name: upload container ...
|
||||
run: |
|
||||
docker login $REGISTRY_HOST -u $REGISTRY_USER -p $REGISTRY_PASS
|
||||
docker push $REGISTRY_HOST/$CONTAINER_TAG:$CONTAINER_VERSION
|
||||
docker logout
|
||||
env:
|
||||
REGISTRY_USER: ${ secrets.REGISTRY_USER }
|
||||
REGISTRY_PASS: ${ secrets.TOKEN_SVC_DOCKER }
|
||||
- name: docker cleanup image and layer ...
|
||||
run: docker builder prune -af
|
||||
Reference in New Issue
Block a user