Actualiser .gitea/workflows/build-push.yaml
This commit is contained in:
@@ -7,9 +7,9 @@ on:
|
||||
|
||||
env:
|
||||
IMAGE_NAME: public/calibre-web
|
||||
TAG: latest
|
||||
REGISTRY_USER: eric@coissac.eu
|
||||
IMAGE_TAGS: latest pmo-${{ env.VERSION }}
|
||||
IMAGE_REGISTRY: niepce.petite-maison-orange.fr
|
||||
REGISTRY_USER: eric@coissac.eu
|
||||
REGISTRY_PASSWORD: ${{ secrets.NIEPCETOKEN }}
|
||||
CHECK: https://haoma.petite-maison-orange.fr/ping/7e80fab1-f1ed-4ece-81aa-cf9061cda5c4
|
||||
RELEASE_FILE: calibre_web_latest.txt
|
||||
@@ -28,8 +28,7 @@ jobs:
|
||||
- name: install Buildah
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y buildah \
|
||||
podman
|
||||
apt-get install -y podman
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
@@ -49,20 +48,15 @@ jobs:
|
||||
# Stocker la valeur dans une variable d'environnement
|
||||
echo "VERSION=$VERSION" >> $GITEA_ENV
|
||||
|
||||
- name: Build image using buildah
|
||||
id: build-image
|
||||
uses: redhat-actions/buildah-build@v2
|
||||
with:
|
||||
image: ${{ env.IMAGE_NAME }}
|
||||
tags: latest pmo-${{ env.VERSION }}
|
||||
layers: true
|
||||
containerfiles: |
|
||||
./Dockerfile
|
||||
extra-args: --storage-driver=overlay --isolation=chroot
|
||||
env:
|
||||
STORAGE_DRIVER: overlay
|
||||
BUILDAH_ISOLATION: "chroot"
|
||||
- name: Podman login
|
||||
run: |
|
||||
podman login ${{ env.REGISTRY }} \
|
||||
-u ${{ env.REGISTRY_USER }} \
|
||||
-p ${{ env.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Build and tag image
|
||||
run: |
|
||||
podman build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAGS }} .
|
||||
|
||||
- name: Canceled building
|
||||
if: cancelled()
|
||||
@@ -82,21 +76,16 @@ jobs:
|
||||
exit 1
|
||||
shell: bash
|
||||
|
||||
- name: Push to Niepce Container Repository
|
||||
id: push-to-niepce
|
||||
uses: redhat-actions/push-to-registry@v2
|
||||
with:
|
||||
image: ${{ steps.build-image.outputs.image }}
|
||||
tags: ${{ steps.build-image.outputs.tags }}
|
||||
registry: ${{ env.IMAGE_REGISTRY }}
|
||||
username: ${{ env.REGISTRY_USER }}
|
||||
password: ${{ env.REGISTRY_PASSWORD }}
|
||||
- name: Push image to registry
|
||||
run: |
|
||||
podman push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAGS }}
|
||||
|
||||
|
||||
- name: Push image failed
|
||||
if: failure()
|
||||
run: |
|
||||
curl -fsS -m 10 --retry 5 \
|
||||
--data-raw "Failed to push docker image for $(cat bluesky_crossposter_latest.txt)" \
|
||||
--data-raw "Failed to push docker image for $(cat ${{ env.RELEASE_FILE }})" \
|
||||
${{ env.CHECK }}/fail
|
||||
exit 1
|
||||
shell: bash
|
||||
@@ -104,16 +93,8 @@ jobs:
|
||||
- name: End of the job
|
||||
run: |
|
||||
curl -fsS -m 10 --retry 5 \
|
||||
--data-raw "Build docker image for $(cat bluesky_crossposter_latest.txt)" \
|
||||
--data-raw "Build docker image for $(cat ${{ env.RELEASE_FILE }})" \
|
||||
${{ env.CHECK }}
|
||||
shell: bash
|
||||
- name: Canceled building
|
||||
if: cancelled()
|
||||
run: |
|
||||
curl -fsS -m 10 --retry 5 \
|
||||
--data-raw "Building image cancelled for $(cat bluesky_crossposter_latest.txt)" \
|
||||
${{ env.CHECK }}/fail
|
||||
exit 1
|
||||
shell: bash
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user