Skip to content

Commit

Permalink
init: init base
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Oct 20, 2024
0 parents commit ccbdeee
Show file tree
Hide file tree
Showing 23 changed files with 633 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/flask.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Base-Flask

on:
push:
branches: ["main"]
paths:
- "base/flask/**"
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:

env:
REGISTRY: ghcr.io
REPOSITORY: challenge-base
NAME: flask

jobs:
build-flask:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Docker setup QEMU
uses: docker/setup-qemu-action@v3

- name: Docker setup Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.NAME }}
tags: |
alpine
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: base/${{ env.NAME }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
push: true

prune-flask:
runs-on: ubuntu-latest
needs: build-flask
permissions:
contents: read
packages: write

steps:
- name: Prune old packages
uses: dataaxiom/ghcr-cleanup-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
package: ${{ env.REPOSITORY }}/${{ env.NAME }}
validate: true
dry-run: false
delete-untagged: true
delete-ghost-images: true
delete-partial-images: true
75 changes: 75 additions & 0 deletions .github/workflows/numpy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Base-Numpy

on:
push:
branches: ["main"]
paths:
- "base/numpy/**"
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:

env:
REGISTRY: ghcr.io
REPOSITORY: challenge-base
NAME: numpy

jobs:
build-numpy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Docker setup QEMU
uses: docker/setup-qemu-action@v3

- name: Docker setup Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.NAME }}
tags: |
latest
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: base/${{ env.NAME }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
push: true

prune-numpy:
runs-on: ubuntu-latest
needs: build-numpy
permissions:
contents: read
packages: write

steps:
- name: Prune old packages
uses: dataaxiom/ghcr-cleanup-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
package: ${{ env.REPOSITORY }}/${{ env.NAME }}
validate: true
dry-run: false
delete-untagged: true
delete-ghost-images: true
delete-partial-images: true
81 changes: 81 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Base-PHP

on:
push:
branches: ["main"]
paths:
- "base/php/**"
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:

env:
REGISTRY: ghcr.io
REPOSITORY: challenge-base
NAME: php

jobs:
build-php:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

strategy:
matrix:
tag: [alpine, 7.4-alpine]
dockerfile: [Dockerfile, Dockerfile.7.4]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Docker setup QEMU
uses: docker/setup-qemu-action@v3

- name: Docker setup Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.NAME }}
tags: |
${{ matrix.tag }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: base/${{ env.NAME }}
file: base/${{ env.NAME }}/${{ matrix.dockerfile }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
push: true

prune-php:
runs-on: ubuntu-latest
needs: build-php
permissions:
contents: read
packages: write

steps:
- name: Prune old packages
uses: dataaxiom/ghcr-cleanup-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
package: ${{ env.REPOSITORY }}/${{ env.NAME }}
validate: true
dry-run: false
delete-untagged: true
delete-ghost-images: true
delete-partial-images: true
148 changes: 148 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
name: Base-Python

on:
push:
branches: ["main"]
paths:
- "base/python/**"
- "base/gmpy2/**"
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:

env:
REGISTRY: ghcr.io
REPOSITORY: challenge-base

jobs:
build-python:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

env:
NAME: python

strategy:
matrix:
tag: [alpine, 3.11-alpine, 3.12-alpine]
dockerfile: [Dockerfile, Dockerfile.3.11, Dockerfile.3.12]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Docker setup QEMU
uses: docker/setup-qemu-action@v3

- name: Docker setup Buildx
uses: docker/setup-buildx-action@v3

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.NAME }}
tags: |
${{ matrix.tag }}
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: base/${{ env.NAME }}
file: base/${{ env.NAME }}/${{ matrix.dockerfile }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
push: true

build-gmpy2:
runs-on: ubuntu-latest
needs: build-python
permissions:
contents: read
packages: write

env:
NAME: gmpy2
TAG: alpine

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Docker setup QEMU
uses: docker/setup-qemu-action@v3

- name: Docker setup Buildx
uses: docker/setup-buildx-action@v3

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.NAME }}
tags: |
${{ env.TAG }}
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: base/${{ env.NAME }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
push: true

prune-python:
runs-on: ubuntu-latest
needs: build-python
permissions:
contents: read
packages: write

steps:
- name: Prune old packages
uses: dataaxiom/ghcr-cleanup-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
package: ${{ env.REPOSITORY }}/python
validate: true
dry-run: false
delete-untagged: true
delete-ghost-images: true
delete-partial-images: true

prune-gmpy2:
runs-on: ubuntu-latest
needs: build-gmpy2
permissions:
contents: read
packages: write

steps:
- name: Prune old packages
uses: dataaxiom/ghcr-cleanup-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
package: ${{ env.REPOSITORY }}/gmpy2
validate: true
dry-run: false
delete-untagged: true
delete-ghost-images: true
delete-partial-images: true
Loading

0 comments on commit ccbdeee

Please sign in to comment.