Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump version to 7.1.2 & switch to gha ci for image deployments #41

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .dockerignore
100644 → 100755
Empty file.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
time: "06:00"
timezone: "Europe/Paris"
labels:
- ":game_die: dependencies"
- ":robot: bot"
64 changes: 64 additions & 0 deletions .github/workflows/PR-CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# This is a basic workflow to help you get started with Actions

name: Test Pull Requests

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
pull_request:
branches: [ master ] #PR's only targeting master

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:

env:
PLATFORM: "linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6"
default_python: "3.9"

strategy:
fail-fast: true
matrix:
python_images: [3.6,3.7,3.8,3.9]
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

-
name: Set up QEMU
uses: docker/setup-qemu-action@v1

-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
install: true

-
name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"

-
name: Build SOPEL for ${{ matrix.python_images }}
env:
IMAGE: adamus1red/sopel
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: ${{ env.PLATFORM }}
build-args: PYTHON_TAG=${{ matrix.python_images }}-alpine
push: ${{ github.event_name != 'pull_request' }}
tags: sopel:test-py${{ matrix.python_images }}
96 changes: 96 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# This is a basic workflow to help you get started with Actions

name: Publish to Docker Hub

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
schedule:
# - cron: '0 10 1,15 * *' # every two weeks at 10am to update latest
- cron: '0 0 * * *' # Nightly build

push:
branches: [ master ]

workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
env:
PLATFORM: "linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6"
default_python: "3.9"

strategy:
fail-fast: true
matrix:
python_images: [3.6,3.7,3.8,3.9]
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

-
name: Set up QEMU
uses: docker/setup-qemu-action@v1

-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
install: true

-
name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"

- name: Generate versions
uses: HardNorth/[email protected]
with:
version-source: file
version-file: Dockerfile
version-file-extraction-pattern: '(?<=SOPEL_BRANCH=v).+'

- name: Inspect Version
id: tags
env:
PYTHON_TAG: ${{ matrix.python_images }}
IMAGE: ${{ secrets.IMAGE }}
version: ${{ env.RELEASE_VERSION }}
run: |
TAGS="${IMAGE}:${version}-py${PYTHON_TAG},${IMAGE}:${version%.*}-py${PYTHON_TAG},${IMAGE}:${version%.*.*}-py${PYTHON_TAG}"
if [[ "x${{ matrix.python_images }}" == "x${{ env.default_python }}" ]] && [[ "${{ github.event_name }}" == "push" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
TAGS="${TAGS},${IMAGE}:${version},${IMAGE}:${version%.*},${IMAGE}:${version%.*.*},${IMAGE}:latest"
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
TAGS="${IMAGE}:${GITHUB_SHA::8},${IMAGE}:nightly"
fi
echo ::set-output name=tags::${TAGS}

-
name: Login to Docker Hub
uses: docker/login-action@v1
if: github.event_name != 'pull_request'
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build SOPEL for ${{ matrix.python_images }}
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: ${{ env.PLATFORM }}
build-args: PYTHON_TAG=${{ matrix.python_images }}-alpine
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.tags.outputs.tags }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ARG SOPEL_REPO=https://github.com/sopel-irc/sopel.git
## Set the specific branch/commit for the source
# This can be a branch name, release/tag, or even specific commit hash.
# Set Docker build-arg SOPEL_BRANCH, or replace the default value below.
ARG SOPEL_BRANCH=v7.1.1
ARG SOPEL_BRANCH=v7.1.2
##

## Do not modify below this !! ##
Expand Down