Files
blueskycrossposter/.gitea/workflows/build-push.yaml
Eric Coissac cff98bd8b6
All checks were successful
Check BlueSky Crossposter version / check-version (push) Successful in 15s
Build and Push Docker Image / build (push) Successful in 2m44s
Actualiser .gitea/workflows/build-push.yaml
2025-04-13 18:20:55 +02:00

104 lines
3.0 KiB
YAML

name: Build and Push Docker Image
on:
push:
branches:
- main # Changez cela si votre branche principale a un autre nom
env:
IMAGE_NAME: public/blueskycrossposter
TAG: latest
REGISTRY_USER: eric@coissac.eu
IMAGE_REGISTRY: niepce.petite-maison-orange.fr
REGISTRY_PASSWORD: ${{ secrets.NIEPCETOKEN }}
CHECK: https://haoma.petite-maison-orange.fr/ping/814308c3-d90c-4511-b236-c40b37a5ad23
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Start the job
run: |
curl -fsS -m 10 --retry 5 \
${{ env.CHECK }}/start
shell: bash
- name: install Buildah
run: |
apt-get update
apt-get install -y buildah \
podman
- name: Checkout code
uses: actions/checkout@v4
- name: Build image starting
run: |
curl -fsS -m 10 --retry 5 \
--data-raw "Buildind docker image for $(cat bluesky_crossposter_latest.txt)" \
${{ env.CHECK }}/log
shell: bash
- name: Set up Buildah
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: latest ${{ github.sha }}
containerfiles: |
./Dockerfile
- 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
- name: Build image failed
if: failure()
run: |
curl -fsS -m 10 --retry 5 \
--data-raw "Failed to build docker image for $(cat bluesky_crossposter_latest.txt)" \
${{ env.CHECK }}/fail
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 failed
if: failure()
run: |
curl -fsS -m 10 --retry 5 \
--data-raw "Failed to push docker image for $(cat bluesky_crossposter_latest.txt)" \
${{ env.CHECK }}/fail
exit 1
shell: bash
- name: End of the job
run: |
curl -fsS -m 10 --retry 5 \
--data-raw "Build docker image for $(cat bluesky_crossposter_latest.txt)" \
${{ 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