Skip to content

Commit

Permalink
github:ci - refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
lehungio committed Jan 5, 2025
1 parent e685a08 commit 35e6601
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 14 deletions.
105 changes: 91 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,52 @@ jobs:
TEST: true
- name: Check code
run: ls -all

manual:
name: 'Manual workflow'
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 2
- name: Set up Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
cache: npm
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
env:
TEST: true
- name: Check code
run: ls -all

automation:
name: 'Automation workflow'
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 2
- name: Set up Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
cache: npm
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
env:
TEST: true
- name: Check code
run: ls -all

# OS
# Ubuntu
build-ubuntu-latest-manual:
name: '[Manual] Build Ubuntu latest'
needs: manual
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -64,6 +105,7 @@ jobs:
build-ubuntu-latest:
name: '[Auto] Build Ubuntu latest'
needs: automation
runs-on: ubuntu-latest
environment: CI
permissions:
Expand Down Expand Up @@ -125,7 +167,9 @@ jobs:

# MacOS
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
build-macos-latest:
build-macos-latest-manual:
name: '[Manual] Build MacOS latest'
needs: manual
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -157,7 +201,9 @@ jobs:
# Windows
# https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md
build-windows-latest:
build-windows-latest-manual:
name: '[Manual] Build Windows latest'
needs: manual
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -186,19 +232,25 @@ jobs:
# QA
# Build Ubuntu for QA
build-ubuntu-qa:
build-ubuntu-qa-manual:
name: '[Manual] Build Ubuntu QA'
needs: manual
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: ubuntu-qa
run: docker build . --file ./ubuntu/qa.Dockerfile --tag "ubuntu-qa:$(date +%s)"
build-ubuntu-noble:
build-ubuntu-noble-manual:
name: '[Manual] Build Ubuntu Noble'
needs: manual
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: ubuntu-noble
run: docker build . --file ./ubuntu/noble.Dockerfile --tag "ubuntu-noble:$(date +%s)"
build-qa-scala:
build-qa-scala-manual:
name: '[Manual] Build QA Scala'
needs: manual
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -207,27 +259,35 @@ jobs:

# PROGRAMMING LANGUAGE
# Build latest PHP version
build-php-latest:
build-php-latest-manual:
name: '[Manual] Build PHP latest'
needs: manual
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: php-fpm
run: docker build . --file ./php/latest.Dockerfile --tag "php:$(date +%s)"
build-php-beta:
build-php-beta-manual:
name: '[Manual] Build PHP beta'
needs: manual
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: php-fpm
run: docker build . --file ./php/beta.Dockerfile --tag "php:$(date +%s)"

# Build latest SCALA version
build-scala-latest:
build-scala-latest-manual:
name: '[Manual] Build Scala latest'
needs: manual
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: scala-latest
run: docker build . --file ./scala/build/latest.Dockerfile --tag "scala-latest:$(date +%s)"
build-scala-bionic:
build-scala-bionic-manual:
name: '[Manual] Build Scala bionic'
needs: manual
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -241,7 +301,9 @@ jobs:
# - name: scala-mantic
# run: docker build . --file ./scala/build/mantic.Dockerfile --tag "scala-mantic:$(date +%s)"
# Build maintenance SCALA version
build-scala-maintenance:
build-scala-maintenance-manual:
name: '[Manual] Build Scala maintenance'
needs: manual
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -250,7 +312,9 @@ jobs:

# APPLICATIONS
# Build latest JENKINS version
build-jenkins-latest:
build-jenkins-latest-manual:
name: '[Manual] Build Jenkins latest'
needs: manual
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -259,13 +323,26 @@ jobs:

# PUPPETEER
# Build latest PUPPETEER version
build-puppeteer-latest:
build-puppeteer-latest-manual:
name: '[Manual] Build Puppeteer latest'
needs: manual
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: puppeteer-latest
run: docker build . --file ./puppeteer/latest.Dockerfile --tag "puppeteer-latest:$(date +%s)"

# REDIS
# Build latest REDIS version
build-redis-latest-manual:
name: '[Manual] Build Redis latest'
needs: manual
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: redis-latest
run: docker build . --file ./database/redis/latest.Dockerfile --tag "redis-latest:$(date +%s)"

# TEST
# API TEST WITH POSTMAN
# MacOS: curl -sL https://dl-cli.pstmn.io/install/osx_64.sh | bash
Expand Down Expand Up @@ -359,7 +436,7 @@ jobs:
# REDASH SETUP MACOS
test-redash-setup-macos:
needs: build-macos-latest
needs: build-macos-latest-manual
runs-on: macos-latest
environment: CI
steps:
Expand Down Expand Up @@ -392,7 +469,7 @@ jobs:
# TEST REDASH DOCKER
test-redash-docker:
needs: build-windows-latest
needs: build-windows-latest-manual
runs-on: windows-latest
environment: CI
steps:
Expand Down
11 changes: 11 additions & 0 deletions database/redis/latest.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# https://github.com/redis/docker-library-redis/blob/e5650da99bb377b2ed4f9f1ef993ff24729b1c16/7.4/debian/Dockerfile
# https://hub.docker.com/_/redis/tags
FROM redis:latest

LABEL org.opencontainers.image.description DESCRIPTION="Redis latest"
LABEL org.opencontainers.image.source=https://github.com/lecaoquochung/docker-images/blob/main/ubuntu/latest.Dockerfile
LABEL org.opencontainers.image.licenses=MIT

# Update package index and install dependencies
RUN apt-get update && \
apt-get install -y git curl iputils-ping telnet vim unzip
6 changes: 6 additions & 0 deletions ubuntu/latest.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Use the official base image
FROM ubuntu:latest

# https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#labelling-container-images
# LABEL org.opencontainers.image.description="Ubuntu latest"
LABEL org.opencontainers.image.description DESCRIPTION="Ubuntu latest"
LABEL org.opencontainers.image.source=https://github.com/lecaoquochung/docker-images/blob/main/ubuntu/latest.Dockerfile
LABEL org.opencontainers.image.licenses=MIT

# Update package index and install dependencies
RUN apt-get update && \
apt-get install -y git curl iputils-ping telnet vim unzip
Expand Down

0 comments on commit 35e6601

Please sign in to comment.