Update .gitea/workflows/simplesbentocreation.yml
This commit is contained in:
@@ -3,14 +3,18 @@ run-name: Build BentoPDF (Simple Mode) based on Upstream
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
# Roda diariamente às 04:00 AM
|
|
||||||
- cron: '0 4 * * *'
|
- cron: '0 4 * * *'
|
||||||
# Permite rodar manualmente pela interface do Gitea
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-and-build:
|
check-and-build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
# --- CORREÇÃO AQUI ---
|
||||||
|
# Forçamos o uso de uma imagem que contém as ferramentas necessárias (como o node para rodar as actions)
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
# ---------------------
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
@@ -23,7 +27,6 @@ jobs:
|
|||||||
- name: Check Upstream Latest Commit
|
- name: Check Upstream Latest Commit
|
||||||
id: check
|
id: check
|
||||||
run: |
|
run: |
|
||||||
# Pega o SHA curto do último commit na branch MAIN do repositório original
|
|
||||||
UPSTREAM_SHA=$(curl -s https://api.github.com/repos/alam00000/bentopdf/commits/main | jq -r .sha | head -c 7)
|
UPSTREAM_SHA=$(curl -s https://api.github.com/repos/alam00000/bentopdf/commits/main | jq -r .sha | head -c 7)
|
||||||
echo "Latest upstream SHA: $UPSTREAM_SHA"
|
echo "Latest upstream SHA: $UPSTREAM_SHA"
|
||||||
echo "sha=$UPSTREAM_SHA" >> $GITHUB_OUTPUT
|
echo "sha=$UPSTREAM_SHA" >> $GITHUB_OUTPUT
|
||||||
@@ -38,7 +41,8 @@ jobs:
|
|||||||
- name: Check if Image Already Exists
|
- name: Check if Image Already Exists
|
||||||
id: exists
|
id: exists
|
||||||
run: |
|
run: |
|
||||||
# Verifica se já temos uma imagem com essa tag no registro local
|
# Nota: O 'docker manifest' pode falhar se o daemon docker não estiver exposto.
|
||||||
|
# Se der erro aqui, o runner precisa ter o socket do docker montado (/var/run/docker.sock)
|
||||||
if docker manifest inspect git.icc.gg/${{ gitea.repository }}:${{ steps.check.outputs.sha }} > /dev/null 2>&1; then
|
if docker manifest inspect git.icc.gg/${{ gitea.repository }}:${{ steps.check.outputs.sha }} > /dev/null 2>&1; then
|
||||||
echo "Image for commit ${{ steps.check.outputs.sha }} already exists."
|
echo "Image for commit ${{ steps.check.outputs.sha }} already exists."
|
||||||
echo "skip=true" >> $GITHUB_OUTPUT
|
echo "skip=true" >> $GITHUB_OUTPUT
|
||||||
@@ -52,16 +56,14 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: alam00000/bentopdf
|
repository: alam00000/bentopdf
|
||||||
ref: main # Usando main conforme solicitado
|
ref: main
|
||||||
|
|
||||||
- name: Inject SIMPLE_MODE into Dockerfile
|
- name: Inject SIMPLE_MODE into Dockerfile
|
||||||
if: steps.exists.outputs.skip == 'false'
|
if: steps.exists.outputs.skip == 'false'
|
||||||
run: |
|
run: |
|
||||||
# Insere a variável de ambiente no final do Dockerfile
|
|
||||||
echo "" >> Dockerfile
|
echo "" >> Dockerfile
|
||||||
echo "ENV SIMPLE_MODE=true" >> Dockerfile
|
echo "ENV SIMPLE_MODE=true" >> Dockerfile
|
||||||
echo "Custom ENV injected successfully."
|
echo "Custom ENV injected successfully."
|
||||||
# Mostra as últimas linhas para confirmar
|
|
||||||
tail -n 5 Dockerfile
|
tail -n 5 Dockerfile
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
|
|||||||
Reference in New Issue
Block a user