Skip to content

Docker

Docker #464

name: Docker
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
schedule:
- cron: '26 22 * * *'
push:
branches: [ master ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
workflow_dispatch:
inputs:
ignore:
description: 'ignore'
required: true
default: 'ignore'
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: 'packagrio/packagr'
# IMAGE_NAME: ${{ github.repository }}
PACKAGR_VERSION: 'latest'
jobs:
alpine:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- version: 'latest'
image: 'alpine:latest'
- version: '3.10'
image: 'alpine:3.10'
- version: '3.9'
image: 'alpine:3.9'
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ${{ github.job }}/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.PACKAGR_VERSION }}-${{ github.job }}${{ matrix.version != 'latest' && matrix.version || '' }}
build-args: |
base_image=${{ matrix.image }}
packagr_version=${{ env.PACKAGR_VERSION }}
# chef:
# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
# strategy:
# matrix:
# include:
# - version: 'latest'
# image: 'chef/chefdk:latest'
# - version: '3.x'
# image: 'chef/chefdk:3.11.4'
# - version: '2.x'
# image: 'chef/chefdk:2.3.17'
# - version: '1.x'
# image: 'chef/chefdk:1.6.1'
# steps:
# - name: Checkout repository
# uses: actions/checkout@v2
# # Login against a Docker registry except on PR
# # https://github.com/docker/login-action
# - name: Log into registry ${{ env.REGISTRY }}
# if: github.event_name != 'pull_request'
# uses: docker/login-action@v1
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
#
#
# # Build and push Docker image with Buildx (don't push on PR)
# # https://github.com/docker/build-push-action
# - name: Build and push Docker image
# uses: docker/build-push-action@v2
# with:
# context: .
# file: ${{ github.job }}/Dockerfile
# push: ${{ github.event_name != 'pull_request' }}
# tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.PACKAGR_VERSION }}-${{ github.job }}${{ matrix.version != 'latest' && matrix.version || '' }}
# build-args: |
# base_image=${{ matrix.image }}
# packagr_version=${{ env.PACKAGR_VERSION }}
golang:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- version: 'latest'
image: 'golang:latest'
- version: '1.22'
image: 'golang:1.22'
- version: '1.18'
image: 'golang:1.18'
- version: '1.17'
image: 'golang:1.17'
- version: '1.16'
image: 'golang:1.16'
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ${{ github.job }}/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.PACKAGR_VERSION }}-${{ github.job }}${{ matrix.version != 'latest' && matrix.version || '' }}
build-args: |
base_image=${{ matrix.image }}
packagr_version=${{ env.PACKAGR_VERSION }}
node:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- version: 'latest'
image: 'node:latest'
- version: '18'
image: 'node:18'
- version: '16'
image: 'node:16'
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ${{ github.job }}/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.PACKAGR_VERSION }}-${{ github.job }}${{ matrix.version != 'latest' && matrix.version || '' }}
build-args: |
base_image=${{ matrix.image }}
packagr_version=${{ env.PACKAGR_VERSION }}
python:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- version: 'latest'
image: 'python:latest'
- version: '3.10'
image: 'python:3.10'
- version: '3.7'
image: 'python:3.7'
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ${{ github.job }}/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.PACKAGR_VERSION }}-${{ github.job }}${{ matrix.version != 'latest' && matrix.version || '' }}
build-args: |
base_image=${{ matrix.image }}
packagr_version=${{ env.PACKAGR_VERSION }}
rockylinux:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- version: 'latest'
image: 'rockylinux:9'
- version: '9'
image: 'rockylinux:9'
- version: '8'
image: 'rockylinux:8'
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ${{ github.job }}/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.PACKAGR_VERSION }}-${{ github.job }}${{ matrix.version != 'latest' && matrix.version || '' }}
build-args: |
base_image=${{ matrix.image }}
packagr_version=${{ env.PACKAGR_VERSION }}
ruby:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- version: 'latest'
image: 'ruby:latest'
- version: '2.7'
image: 'ruby:2.7'
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ${{ github.job }}/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.PACKAGR_VERSION }}-${{ github.job }}${{ matrix.version != 'latest' && matrix.version || '' }}
build-args: |
base_image=${{ matrix.image }}
packagr_version=${{ env.PACKAGR_VERSION }}
ubuntu:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- version: 'latest'
image: 'ubuntu:latest'
- version: '22.10'
image: 'ubuntu:22.10'
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ${{ github.job }}/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.PACKAGR_VERSION }}-${{ github.job }}${{ matrix.version != 'latest' && matrix.version || '' }}
build-args: |
base_image=${{ matrix.image }}
packagr_version=${{ env.PACKAGR_VERSION }}