move build image workflow to reusing repo
This commit is contained in:
parent
ac18a7046d
commit
516b493b47
28
.gitea/workflows/build-image.yml
Normal file
28
.gitea/workflows/build-image.yml
Normal file
@ -0,0 +1,28 @@
|
||||
name: Build Image
|
||||
run-name: ${{ gitea.actor }} build image and push to container registry
|
||||
on:
|
||||
workflow_call:
|
||||
secrets:
|
||||
REGISTRY_USER:
|
||||
required: true
|
||||
REGISTRY_PASSWORD:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
Build-Image:
|
||||
runs-on: [self-hosted]
|
||||
steps:
|
||||
- run: echo "The job was automatically triggered by a ${{ gitea.event_name }} event."
|
||||
- run: echo "This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
||||
- run: echo "The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
||||
- name: Check out repository code
|
||||
uses: http://gitea.pena:3000/PenaDevops/actions.git/checkout@v1
|
||||
- run: echo "The workflow is now ready to test your code on the runner."
|
||||
- run: podman login -u ${{ secrets.REGISTRY_USER }} -p ${{ secrets.REGISTRY_PASSWORD }} gitea.pena:3000
|
||||
- name: set lower case repository
|
||||
run: |
|
||||
echo "REPOSITORY_LC=${REPOSITORY,,}" >>${GITEA_ENV}
|
||||
env:
|
||||
REPOSITORY: '${{ gitea.repository }}'
|
||||
- run: podman build -t gitea.pena:3000/${{ env.REPOSITORY_LC }}/${{ gitea.ref_name }}:${{ gitea.run_id }} .
|
||||
- run: podman push gitea.pena:3000/${{ env.REPOSITORY_LC }}/${{ gitea.ref_name }}:${{ gitea.run_id }}
|
Loading…
Reference in New Issue
Block a user