updated workflow
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
name: Build Docker Image
|
||||
run-name: ${{ gitea.actor }} building ${{ gitea.ref_name }}
|
||||
on: [push]
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
Docker-Build:
|
||||
@@ -12,7 +16,30 @@ jobs:
|
||||
- name: Build docker image
|
||||
run: docker build -t web4rail .
|
||||
|
||||
- name: Store tag date
|
||||
run: |
|
||||
TAG=$(date +%Y%m%d_%H%M)_${{ gitea.ref_name }}
|
||||
echo $TAG > /tmp/tag
|
||||
echo Using '"'$TAG'"' as tag.
|
||||
|
||||
- name: Tag image for upload
|
||||
run: |
|
||||
TAG=$(cat /tmp/tag)
|
||||
docker tag web4rail ${{ secrets.REGISTRY_PATH }}/web4rail:${{ gitea.ref_name }}
|
||||
docker tag web4rail ${{ secrets.REGISTRY_PATH }}/web4rail:$TAG
|
||||
|
||||
- name: Login to registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${{ secrets.REGISTRY_PATH }}
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASS }}
|
||||
|
||||
- name: Push to registry
|
||||
run: |
|
||||
TAG=$(cat /tmp/tag)
|
||||
docker push ${{ secrets.REGISTRY_PATH }}/web4rail:${{ gitea.ref_name }}
|
||||
docker push ${{ secrets.REGISTRY_PATH }}/web4rail:$TAG
|
||||
|
||||
Clean-Registry:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
Reference in New Issue
Block a user