docker-openj9-piped/.forgejo/workflows/build_and_release.yml

72 lines
2.2 KiB
YAML
Raw Permalink Normal View History

2025-03-05 18:24:11 +04:00
name: Docker Image CI
on:
push:
2025-03-12 18:30:22 +04:00
2025-03-05 18:24:11 +04:00
pull_request:
env:
REGISTRY: git.dc09.ru # Change to your registry (e.g., forgejo.example.com)
2025-03-09 15:47:18 +04:00
GITHUB_TOKEN: ${{ secrets.FORGEJO_PASSWORD }}
GITHUB_API_URL: https://git.dc09.ru
GITHUB_BASE_REF: git.dc09.ru
GITHUB_SERVER_URL: https://git.dc09.ru
DOCKERHUB_TOKEN: ${{ secrets.FORGEJO_PASSWORD }}
DOCKER_TOKEN: ${{ secrets.FORGEJO_PASSWORD }}
2025-03-05 18:24:11 +04:00
FORGEJO_URL: https://git.dc09.ru
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
images:
- dockerfile: 'Dockerfile.openj9'
image_name: 'openj9'
context: './'
2025-03-12 18:30:22 +04:00
build-args: ["WITH_JDK=false"]
2025-03-05 18:24:11 +04:00
- dockerfile: 'Dockerfile.piped'
image_name: 'piped'
context: './'
2025-03-12 18:30:22 +04:00
build-args: []
2025-03-05 18:24:11 +04:00
# Add more images as needed
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
2025-03-09 15:47:18 +04:00
registry: git.dc09.ru
username: ${{ secrets.FORGEJO_USERNAME }}
password: ${{ secrets.FORGEJO_PASSWORD }}
token: ${{ secrets.FORGEJO_PASSWORD }}
opts.auth: ${{ secrets.FORGEJO_PASSWORD }}
- name: Printenv
run: env | sort
2025-03-05 18:24:11 +04:00
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
2025-03-09 15:47:18 +04:00
context: git
2025-03-05 18:24:11 +04:00
images: |
2025-03-09 18:44:57 +04:00
git.dc09.ru/${{ env.GITHUB_REPOSITORY_OWNER }}/${{ matrix.images.image_name }}
2025-03-05 18:24:11 +04:00
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
2025-03-09 15:47:18 +04:00
github-token: ${{ secrets.FORGEJO_PASSWORD }}
github-server: https://git.dc09.ru
2025-03-05 18:24:11 +04:00
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
2025-03-09 15:47:18 +04:00
context: ${{ matrix.images.context }}
file: ${{ matrix.images.dockerfile }}
2025-03-05 18:24:11 +04:00
push: ${{ github.event_name == 'push' }}
tags: ${{ steps.meta.outputs.tags }}
2025-03-12 18:30:22 +04:00
labels: ${{ steps.meta.outputs.labels }}
build-args: ${{ matrix.images.build-args }}