Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
07fbaf6b31
|
|||
|
1c4cac54c7
|
|||
|
702551d66a
|
|||
|
d4331bbef4
|
|||
|
e81cd81797
|
|||
|
9423cbc331
|
|||
|
915a2fc67e
|
|||
|
afec455c18
|
|||
|
0188e62126
|
|||
|
67833554bc
|
|||
|
6418e84257
|
38
action.yml
38
action.yml
@ -10,10 +10,24 @@ inputs:
|
|||||||
desciption: 'name of the package'
|
desciption: 'name of the package'
|
||||||
required: false
|
required: false
|
||||||
default: '${{ gitea.repository }}'
|
default: '${{ gitea.repository }}'
|
||||||
|
username:
|
||||||
|
description: 'username used to push the package'
|
||||||
|
required: true
|
||||||
|
password:
|
||||||
|
description: 'password used to push the package'
|
||||||
|
required: true
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: get commit hash
|
||||||
|
id: get_hash
|
||||||
|
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
@ -21,12 +35,28 @@ runs:
|
|||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: git.tmoron.fr
|
registry: git.tmoron.fr
|
||||||
username: ${{ secrets.PUSH_USERNAME }}
|
username: ${{ inputs.username }}
|
||||||
password: ${{ secrets.PUSH_PASSWORD }}
|
password: ${{ inputs.password }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
context: ${{ inputs.path }}
|
context: "{{defaultContext}}:${{ input.path }}"
|
||||||
push: true
|
push: true
|
||||||
tags: git.tmoron.fr/${{ inputs.name }}:latest
|
tags: git.tmoron.fr/${{ inputs.name }}:${{ steps.get_hash.outputs.sha_short }}
|
||||||
|
|
||||||
|
- name: push to latest branch
|
||||||
|
run: |
|
||||||
|
git config user.name "auto"
|
||||||
|
git config user.email "auto@auto.com"
|
||||||
|
|
||||||
|
if git ls-remote --exit-code --heads origin latest; then
|
||||||
|
git switch latest
|
||||||
|
git merge master
|
||||||
|
else
|
||||||
|
git checkout -b latest
|
||||||
|
fi
|
||||||
|
sed -i -E "s/image: (.*):.*/image: \1:${{ steps.get_hash.outputs.sha_short }}/" deployment.yaml
|
||||||
|
git add deployment.yaml
|
||||||
|
git commit -m "auto: set image tag in deployment"
|
||||||
|
git push origin latest
|
||||||
|
|||||||
Reference in New Issue
Block a user