Skip to content

fix: dockerfile openssl cant send uco mail #164

fix: dockerfile openssl cant send uco mail

fix: dockerfile openssl cant send uco mail #164

Workflow file for this run

name: CI-CD
on:
push:
branches:
- "master"
- "releases/**"
tags:
- v[0-9]+.[0-9]+.[0-9]+
pull_request: ~
env:
DOCKER_BUILDKIT: 1
jobs:
quality:
name: Quality
runs-on: ubuntu-latest
strategy:
matrix:
php: ["8.1"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: "none"
extensions: "json,openssl,mbstring,xml,ctype,iconv,intl"
ini-values: "memory_limit=-1"
php-version: "${{ matrix.php }}"
tools: composer:v2, prestissimo, flex
- name: Determine composer cache directory
id: composer-cache
run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.directory }}
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ matrix.php }}-composer-
- name: Install Composer dependencies
run: |
composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader --ansi
- name: Quality
run: |
vendor/bin/psalm
vendor/bin/phpcs
images:
runs-on: ubuntu-latest
needs: quality
if: github.event_name == 'push' && github.repository == 'aulasoftwarelibre/idea' && (startsWith(github.ref, 'refs/heads/releases/') || startsWith(github.ref, 'refs/tags/v') )
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Nota: actions/cache@v4 es necesario aquí
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.CR_USER }}
password: ${{ secrets.CR_PAT }}
- name: Extract tag name
id: extract_tag
run: echo "tag=$(echo ${GITHUB_REF##*/})" >> $GITHUB_OUTPUT
- name: Build and push php
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
target: idea_php
tags: |
ghcr.io/aulasoftwarelibre/idea-php:latest
ghcr.io/aulasoftwarelibre/idea-php:${{ steps.extract_tag.outputs.tag }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
- name: Build and push httpd
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
target: idea_httpd
tags: |
ghcr.io/aulasoftwarelibre/idea-httpd:latest
ghcr.io/aulasoftwarelibre/idea-httpd:${{ steps.extract_tag.outputs.tag }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
update-manifest:
runs-on: ubuntu-latest
needs: images
if: github.event_name == 'push' && github.repository == 'aulasoftwarelibre/idea' && (startsWith(github.ref, 'refs/heads/releases/') || startsWith(github.ref, 'refs/tags/v') )
steps:
- name: Extract tag name
id: extract_tag
run: echo "tag=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
- name: Checkout config repository (aulasoftwarelibre/charts)
uses: actions/checkout@v4
with:
repository: aulasoftwarelibre/charts
path: charts
token: ${{ secrets.CHARTS_REPO_PAT }}
- name: Update image tag in manifests
run: |
TAG="${{ steps.extract_tag.outputs.tag }}"
sed -i "s|image: ghcr.io/aulasoftwarelibre/idea-php:.*|image: ghcr.io/aulasoftwarelibre/idea-php:$TAG|g" charts/ideas/php-deployment.yaml
sed -i "s|image: ghcr.io/aulasoftwarelibre/idea-httpd:.*|image: ghcr.io/aulasoftwarelibre/idea-httpd:$TAG|g" charts/ideas/httpd-deployment.yaml
- name: Commit and push changes
run: |
cd charts
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
if ! git diff --staged --quiet; then
git commit -m "ci: Update idea images to tag ${{ steps.extract_tag.outputs.tag }}"
git push
else
echo "No changes to commit. El YAML ya estaba actualizado."
fi