.gitea/workflows/publish-packages.yaml hinzugefügt
This commit is contained in:
1 parent
5c83900d02
commit
7959a24e30
1 file changed
+37
@@ -0,0 +1,37 @@
|
||||
name: Docker Image in Gitea Packages veroeffentlichen
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: docker:latest
|
||||
steps:
|
||||
- name: Code auschecken
|
||||
run: |
|
||||
apk add --no-cache curl unzip
|
||||
curl -L -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||
"http://172.17.0.1:3000/api/v1/repos/${{ github.repository }}/archive/main.zip" -o repo.zip
|
||||
unzip repo.zip
|
||||
mv PsalmTafel/* . 2>/dev/null || mv psalmtafel/* . 2>/dev/null || mv */* . 2>/dev/null
|
||||
rm repo.zip
|
||||
|
||||
- name: Bei Gitea Container Registry anmelden
|
||||
run: |
|
||||
echo "${{ secrets.GITEA_TOKEN }}" | docker login 172.17.0.1:3000 -u ${{ github.actor }} --password-stdin
|
||||
|
||||
- name: Docker Image bauen und pushen
|
||||
run: |
|
||||
# Repository-Name in Kleinbuchstaben umwandeln
|
||||
REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
|
||||
IMAGE_TAG="172.17.0.1:3000/${REPO_LOWER}:latest"
|
||||
|
||||
echo "Baue das Docker-Image..."
|
||||
docker build -t $IMAGE_TAG .
|
||||
|
||||
echo "Pushe das Image in die Gitea Paketverwaltung..."
|
||||
docker push $IMAGE_TAG
|
||||
Reference in new issue
Block a user