Skip to content

Commit

Permalink
Added git workflow to build and publish dev docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
craigk5n committed Sep 25, 2023
1 parent 29c9476 commit 0162dfa
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
bump_version.sh
docker
docs
*.git
*.gitignore
includes/settings.php
java
Makefile
release-files
tests
TODO
vendor
ws
38 changes: 38 additions & 0 deletions .github/workflows/docker-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish Dev Docker Image

on:
push:
branches:
- master

jobs:
push_dev_to_registry:
name: Push Development Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Extract Commit Hash
id: extract_hash
run: echo "::set-output name=hash::$(git rev-parse --short HEAD)"

- name: Get WebCalendar Version
run: echo "WEBCALENDAR_VERSION=$(./bump_version.sh -p)" >> $GITHUB_ENV

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ./docker/Dockerfile-php8
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/webcalendar:${{ env.WEBCALENDAR_VERSION }}-${{ steps.extract_hash.outputs.hash }}-php8-apache-dev
${{ secrets.DOCKER_HUB_USERNAME }}/webcalendar:dev-php8-apache
${{ secrets.DOCKER_HUB_USERNAME }}/webcalendar:dev
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

0 comments on commit 0162dfa

Please sign in to comment.