-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci👷♂️: build and publish two latex images
- Loading branch information
1 parent
fc8788e
commit a70631d
Showing
1 changed file
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Publicar imagen Docker (LaTeX) | ||
|
||
on: | ||
schedule: | ||
- cron: '0 20 1 * *' | ||
workflow_dispatch: | ||
push: | ||
paths: | ||
- latex/** | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write | ||
|
||
strategy: | ||
matrix: | ||
dockerfile: [latex/full/Dockerfile, latex/min/Dockerfile] | ||
include: | ||
- dockerfile: latex/full/Dockerfile | ||
tag_suffix: full | ||
- dockerfile: latex/min/Dockerfile | ||
tag_suffix: min | ||
|
||
steps: | ||
- name: Revisar repositorio | ||
uses: actions/checkout@v3 | ||
|
||
- name: Instalar cosign | ||
if: github.event_name != 'pull_request' | ||
uses: sigstore/[email protected] | ||
with: | ||
cosign-release: 'v2.1.1' | ||
|
||
- name: Configurar Docker buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Iniciar sesión en el registro ${{ env.REGISTRY }} | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extraer metadatos de Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.tag_suffix }} | ||
|
||
- name: Construir y publicar imagen Docker | ||
id: build-and-push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ${{ matrix.dockerfile }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Firmar la imagen Docker publicada | ||
if: ${{ github.event_name != 'pull_request' }} | ||
env: | ||
TAGS: ${{ steps.meta.outputs.tags }} | ||
DIGEST: ${{ steps.build-and-push.outputs.digest }} | ||
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} |