Skip to content

Commit

Permalink
Updated README and CI becase v24 dropped support for Python 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
haxorof committed Mar 31, 2024
1 parent 8a55b18 commit 414b894
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
os: [almalinux, alpine]
os: [alpine]
version: [v5, v6, v24]
steps:
- name: Checkout
Expand Down
123 changes: 123 additions & 0 deletions .github/workflows/ci_almalinux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '0 0 * * 0'

env:
IMAGE_NAME: haxorof/ansible-lint
LATEST_VERSION: v6

jobs:
build_push:
runs-on: ubuntu-latest
strategy:
matrix:
os: [almalinux]
version: [v5, v6]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Prepare
id: prep
run: |
cp requirements/${MATRIX_VERSION}/requirements.txt requirements/requirements.txt
TAGS="${IMAGE_NAME}:${MATRIX_VERSION}-${MATRIX_OS}"
TEST_TAG="${TAGS}"
if [[ "$MATRIX_VERSION" == "$LATEST_VERSION" ]]; then
TAGS="${TAGS},${IMAGE_NAME}:latest-${MATRIX_OS}"
fi
echo "test_tag=${TEST_TAG}" >> $GITHUB_OUTPUT
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
env:
MATRIX_OS: ${{ matrix.os }}
MATRIX_VERSION: ${{ matrix.version }}

- name: Lint Dockerfile
uses: docker://replicated/dockerfilelint:latest
with:
args: Dockerfile.${{ matrix.os }}

- name: Set up Docker Buildx
uses: docker/[email protected]

- name: Build and Push
uses: docker/[email protected]
with:
load: true
labels: |
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.source=${{ github.repositoryUrl }}
org.opencontainers.image.version=${{ matrix.version }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.licenses=${{ github.event.repository.license.name }}
tags: ${{ steps.prep.outputs.test_tag }}
context: .
file: ./Dockerfile.${{ matrix.os }}

- name: Test built image
run: |
docker run --rm -v ${PWD}/test/${{ matrix.version }}:/mnt:ro ${{ steps.prep.outputs.test_tag }} -vv --force-color .
- name: Login to DockerHub
uses: docker/[email protected]
if: ${{ endsWith(github.ref, '/master') }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and Push
uses: docker/[email protected]
with:
labels: |
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.source=${{ github.repositoryUrl }}
org.opencontainers.image.version=${{ matrix.version }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.licenses=${{ github.event.repository.license.name }}
tags: ${{ steps.prep.outputs.tags }}
context: .
file: ./Dockerfile.${{ matrix.os }}
push: ${{ endsWith(github.ref, '/master') }}

dependabot:
if: ${{ github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' }}
needs: build_push
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
if: ${{steps.dependabot-metadata.outputs.package-ecosystem == 'github_actions'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

update_docker_hub_description:
if: ${{ endsWith(github.ref, '/master') }}
needs: build_push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: ${{ env.IMAGE_NAME }}
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@

## Simple Tags

- `v24-alpine`
- `v6-almalinux`
- `v6-alpine`
- `v5-almalinux`
- `v5-alpine`

## Shared Tags

- `v6`, `latest-alpine`, `latest`
- `v24`, `latest-alpine`, `latest`
- `v24-alpine`
- `v6`
- `v6-alpine`
- `v5`
- `v5-alpine`
Expand Down

0 comments on commit 414b894

Please sign in to comment.