Skip to content

Introduce CI container and optimize workflows #13

Introduce CI container and optimize workflows

Introduce CI container and optimize workflows #13

name: Build Container
on:
push:
branches:
- master
paths:
- '.ci/container/**'
pull_request:
paths:
- '.ci/container/**'
workflow_dispatch:
permissions:
packages: write
contents: read
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Lowercase repository name
run: |
echo "REPO=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .ci/container
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/${{ env.REPO }}/ci-container:latest,ghcr.io/codenameone/codenameone/ci-container:latest