0.0.19 #19
Workflow file for this run
This file contains hidden or 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
| name: build_and_push | |
| on: | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| build_and_push: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: Production | |
| url: 'https://iconify.tools.logitud.cloud' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to registry | |
| uses: docker/login-action@v3 | |
| with: | |
| username: 'nologin' | |
| password: '${{ secrets.REGISTRY_PASS }}' | |
| registry: '${{ secrets.REGISTRY_URL }}' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Setup env file | |
| run: | | |
| echo "S3_BUCKET_NAME=${{ secrets.S3_BUCKET_NAME }}" > .env | |
| echo "S3_REGION=${{ secrets.S3_REGION }}" >> .env | |
| echo "S3_ENDPOINT=${{ secrets.S3_ENDPOINT }}" >> .env | |
| echo "S3_ACCESS_KEY_ID=${{ secrets.S3_ACCESS_KEY_ID }}" >> .env | |
| echo "S3_SECRET_ACCESS_KEY=${{ secrets.S3_SECRET_ACCESS_KEY }}" >> .env | |
| - name: Prepare icons | |
| run: npm run importer | |
| - name: Validate src and icons directories | |
| run: | | |
| echo "🔍 Vérification pré-build…" | |
| for d in src icons; do | |
| if [ ! -d "$d" ]; then | |
| echo "❌ Directory '$d' not found in repo." | |
| exit 1 | |
| fi | |
| if [ -z "$(ls -A "$d")" ]; then | |
| echo "❌ Directory '$d' is empty." | |
| exit 1 | |
| fi | |
| done | |
| echo "✅ src and icons directories are present and non-empty." | |
| - name: Build and push Image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| tags: | | |
| ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_REPO }}/iconify:${{ github.ref_name }} | |
| ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_REPO }}/iconify:latest | |
| platforms: linux/amd64 | |
| build-args: | | |
| ICONIFY_API_VERSION=${{ github.ref_name }} | |
| SRC_PATH=${{ github.workspace }}/ | |
| TAG_SUFFIX=default | |
| BUILD_DATE="$(date +"%Y-%m-%dT%H:%M:%SZ")" |