Skip to content

WIP on github workflows #9

WIP on github workflows

WIP on github workflows #9

Workflow file for this run

name: Build and Push Docker Images
on:
push:
workflow_dispatch:
# schedule:
# - cron: '0 0 * * *' # runs every day at midnight
#
defaults:
run:
shell: bash -euo pipefail {0}
jobs:
build-and-push:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.repository }}-${{ github.workflow_ref }}-${{ matrix.alpine_version }}-build
cancel-in-progress: false
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
alpine_version:
- latest
- edge
- 3.1
- 3.2
- 3.3
- 3.4
- 3.5
- 3.6
- 3.7
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12
- 3.13
- 3.14
- 3.15
- 3.16
- 3.17
- 3.18
- 3.19
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Image
run: |
if [ -f "Dockerfile-${{ matrix.alpine_version }}" ]; then
DOCKERFILE="Dockerfile-${{ matrix.alpine_version }}"
else
DOCKERFILE="Dockerfile"
fi
docker buildx build \
--push \
--platform linux/amd64,linux/arm64 \
--tag andrius/alpine-ruby:${{ matrix.alpine_version }} \
--build-arg ALPINE_VERSION=${{ matrix.alpine_version }} \
--file $DOCKERFILE \
.