Skip to content

add firefox esr ubuntu #320

add firefox esr ubuntu

add firefox esr ubuntu #320

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI.build.template
# Controls when the action will run. Triggers the workflow on push or pull request
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
release: ${{ github.ref_name }}
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
generateInputDockerFile:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
commit_hash: ${{ steps.set-matrix.outputs.commit_hash }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "18.x"
- name: Install dependencies
run: npm install
- name: generate Dockerfiles
run: node make.js -r ${{ github.ref_name }}
- name: Generate matrix with all Dockerfiles of the repository
id: set-matrix
run: |
dockerfiles=$(ls -l *.d | grep '^-' | awk -F ' ' '{print $9}' | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "dockerfiles=$dockerfiles"
# dockerfiles is an array of filename
# echo "::set-output name=matrix::$dockerfiles"
echo "matrix=$dockerfiles" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
with:
name: artifact-dockerfiles
path: "*.d"
if-no-files-found: warn # 'error' or 'ignore' are also available, defaults to `warn`
build:
needs: generateInputDockerFile
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
outputs:
matrix: ${{ steps.set-jsonimage.outputs.matrix }}
strategy:
fail-fast: false
matrix:
path: ${{ fromJson(needs.generateInputDockerFile.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: dump github.ref_name
run: echo "${{ github.ref_name }}"
# overwrite previous Dockerfiles
- uses: actions/download-artifact@v4
with:
name: artifact-dockerfiles
- name: Current Dockerfile
run: |
echo Dockerfile ${{ matrix.path }}
ls -la ${{ matrix.path }}
cat ${{ matrix.path }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Define platforms
id: define-platforms
run: |
PLATFORMS=$(grep "# platforms=" ${{ matrix.path }} | awk -F "=" '{print $2 }')
echo "platforms=$PLATFORMS"
echo "platforms=$PLATFORMS" >> "$GITHUB_OUTPUT"
- name: Build and push ${{ matrix.path }}
env:
image: ${{ matrix.path }}
imagetag: ${{ github.ref_name || 'main' }}
uses: docker/build-push-action@v5
with:
file: ${{ env.image }}
context: .
platforms: ${{ steps.define-platforms.outputs.platforms }}
build-args: |
TAG=${{ env.imagetag }}
push: true
tags: |
abcdesktopio/${{ env.image }}:${{ env.imagetag }}
- uses: actions/upload-artifact@v4
env:
image: ${{ matrix.path }}
imagetag: ${{ github.ref_name || 'main' }}
with:
name: artifact.${{ env.image }}.${{ env.imagetag }}
path: ${{ env.image }}
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
- name: Repository Dispatch json event new image is pushed
env:
image: ${{ matrix.path }}
imagetag: ${{ github.ref_name || 'main' }}
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.TOKEN_DISPATCH }}
repository: abcdesktopio/images
event-type: dispatch-json-from-oc.apps
client-payload: '{ "ref_name": "${{ github.ref_name }}", "image": "${{ env.image }}", "tag": "${{ env.imagetag }}","run_id": "${{ github.run_id }}"}'
generateDocumentation:
needs: build
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: actions/download-artifact@v4
with:
name: artifact-dockerfiles
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "18.x"
- name: Install dependencies
run: npm install
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# node make-docs.js --release ${{ github.ref_name }}
- name: generate MarkDown files
run: |
node make-docs.js --release ${{ github.ref_name }}
- uses: actions/upload-artifact@v4
with:
name: artifact-application-md-files
path: "*.md"
if-no-files-found: error # 'error' or 'ignore' are also available, defaults to `warn`
- name: Repository Dispatch to doc
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.TOKEN_DISPATCH }}
repository: abcdesktopio/docs
event-type: dispatch-from-oc.apps
client-payload: '{ "workflow": "${{ github.workflow }}", "ref_name": "${{ github.ref_name }}", "repository": "${{ github.repository }}", "run_id": "${{ github.run_id }}", "run_number": "${{ github.run_number }}", "artifact": "artifact-application-md-files" }'
- name: Repository Dispatch dockerfiles to images
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.TOKEN_DISPATCH }}
repository: abcdesktopio/images
event-type: dispatch-dockerfile-from-oc.apps
client-payload: '{ "workflow": "${{ github.workflow }}", "ref_name": "${{ github.ref_name }}", "repository": "${{ github.repository }}", "run_id": "${{ github.run_id }}", "run_number": "${{ github.run_number }}", "artifact": "artifact-dockerfiles" }'
#- name: commit Dockerfiles and md files
# env:
# CI_COMMIT_MESSAGE: Continuous Integration Build Artifacts
# CI_COMMIT_AUTHOR: ${{ github.event.repository.name }} Continuous Integration
# uses: nick-fields/retry@v2
# with:
# timeout_minutes: 10
# max_attempts: 3
# command: |
# git config --global pull.ff only
# git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
# git config --global user.email "abcdesktop@users.noreply.github.com"
# git add *.md *.d
# git commit -m "${{ env.CI_COMMIT_MESSAGE }}" *.md
# git push origin ${{ github.head_ref }}