Compare commits
6 Commits
v1
...
915a2fc67e
| Author | SHA1 | Date | |
|---|---|---|---|
|
915a2fc67e
|
|||
|
afec455c18
|
|||
|
0188e62126
|
|||
|
67833554bc
|
|||
|
6418e84257
|
|||
|
f538683ab2
|
27
action.yml
27
action.yml
@ -1,3 +1,6 @@
|
||||
name: docker setup and build
|
||||
author: tom
|
||||
descriptions: setup, login, builds and pushes a container as a package
|
||||
inputs:
|
||||
path:
|
||||
description: 'the path where buildx should start'
|
||||
@ -7,10 +10,18 @@ inputs:
|
||||
desciption: 'name of the package'
|
||||
required: false
|
||||
default: '${{ gitea.repository }}'
|
||||
username:
|
||||
description: 'username used to push the package'
|
||||
required: true
|
||||
password:
|
||||
description: 'password used to push the package'
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
@ -18,12 +29,22 @@ runs:
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: git.tmoron.fr
|
||||
username: ${{ secrets.PUSH_USERNAME }}
|
||||
password: ${{ secrets.PUSH_PASSWORD }}
|
||||
username: ${{ inputs.username }}
|
||||
password: ${{ inputs.password }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: ${{ inputs.path }}
|
||||
context: "{{defaultContext}}:${{ input.path }}"
|
||||
push: true
|
||||
tags: git.tmoron.fr/${{ inputs.name }}:latest
|
||||
|
||||
- name: push to latest branch
|
||||
run: |
|
||||
if git ls-remote --exit-code --heads origin latest; then
|
||||
git switch latest
|
||||
git merge latest
|
||||
else
|
||||
git checkout -b latest
|
||||
git push origin latest
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user