Skip to content

Commit

Permalink
Add initial version of SMWMailer
Browse files Browse the repository at this point in the history
  • Loading branch information
dfuchss committed Sep 25, 2023
0 parents commit 7f4cc97
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: "actions"
directory: "/"
schedule:
interval: "weekly"
day: "wednesday"
time: "11:00"
timezone: "Europe/Berlin"
commit-message:
prefix: "Dependency"
include: "scope"
57 changes: 57 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Docker Push

on:
workflow_dispatch:
push:
# Publish `main` as Docker `latest` image.
branches:
- main
paths-ignore:
- '**.md'
- '.github/**'

# Publish `v1.2.3` tags as releases.
tags:
- v*

env:
IMAGE_NAME: smwmailer

jobs:
push:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME

- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin

- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "main" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM php:7.4-cli

ENV TZ=Europe/Berlin

RUN apt-get update && \
apt-get install -y zip unzip locales &&\
sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen &&\
locale-gen

0 comments on commit 7f4cc97

Please sign in to comment.