Skip to content

Action Update: Bump docker/bake-action from 4 to 5 (#24) #78

Action Update: Bump docker/bake-action from 4 to 5 (#24)

Action Update: Bump docker/bake-action from 4 to 5 (#24) #78

name: Build Docker Images
on:
push:
branches:
- '**'
paths:
- 'export/**'
- 'python2.7/**'
- '.github/workflows/build-docker-images.yml'
- 'docker-bake.hcl'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
packages: write
env:
DOCKER_USERNAME: cyb3rjak3
jobs:
Publish:
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
target: ["python-2_7", "alpine-pypy-builder", "alpine-pypy-builder-bootstrap", "alpine-pypy-2_7", "alpine-pypy-3_9", "alpine-pypy-3_10"]
runner: ["ubuntu-latest", "self-hosted"]
# Don't know a better way to only run python-2_7 on self-hosted
exclude:
- target: "python-2_7"
runner: "ubuntu-latest"
- target: "alpine-pypy-builder"
runner: "self-hosted"
- target: "alpine-pypy-builder-bootstrap"
runner: "self-hosted"
- target: "alpine-pypy-2_7"
runner: "self-hosted"
- target: "alpine-pypy-3_9"
runner: "self-hosted"
- target: "alpine-pypy-3_10"
runner: "self-hosted"
steps:
- uses: actions/checkout@v4
- name: Login to Docker
uses: docker/login-action@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login To GitHub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Meta
id: meta
uses: docker/metadata-action@v5
with:
flavor: |
latest=false
images: cyb3rjak3/${{ matrix.target }}
labels: |
org.label-schema.vcs-url=https://github.com/Cyb3r-Jak3/docker-alpine-pypy.git
maintainer=Cyb3r Jak3 [email protected]
org.opencontainers.image.vendor=cyb3rjak3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build ${{ matrix.target }}
uses: docker/bake-action@v5
with:
files: |
${{ steps.meta.outputs.bake-file }}
./docker-bake.hcl
targets: ${{ matrix.target }}-release
push: ${{ github.ref == 'refs/heads/main' }}
pull: true
set: |
*.cache-from=type=registry,ref=ghcr.io/cyb3r-jak3/alpine-pypy-cache:${{ matrix.target }}
*.cache-to=type=registry,ref=ghcr.io/cyb3r-jak3/alpine-pypy-cache:${{ matrix.target }},mode=max
Update-DockerHub:
runs-on: ubuntu-latest
name: Update DockerHub Descriptions
needs: Publish
if: github.ref == 'refs/heads/main'
strategy:
fail-fast: false
matrix:
repository: ["alpine-pypy", "python-2.7.18", "alpine-pypy-builder"]
steps:
- uses: actions/checkout@v4
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: "${{ env.DOCKER_USERNAME }}/${{ matrix.repository }}"