Skip to content

Commit

Permalink
refactored workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
giohappy committed Oct 9, 2023
1 parent bbb6e84 commit d63dd51
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 167 deletions.
34 changes: 34 additions & 0 deletions .github/actions/build_and_push/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Sahred Docker image creation steps

inputs:
image:
required: true
tag:
required: true
branch:
default: "master"
push:
default: false

runs:
using: "composite"
steps:
- uses: actions/checkout@v2
with:
ref: ${{ inputs.branch }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
file: ./docker/${{ inputs.image }}/Dockerfile
context: "./docker/${{ inputs.image }}/"
push: ${{ inputs.push }}
tags: giohappy/${{ inputs.image }}:${{ inputs.tag }}
52 changes: 0 additions & 52 deletions .github/workflows/geoserver.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/geoserver_data_dir.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/letsencrypt.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/nginx.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .github/workflows/postgis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ on:
branches: [ "master" ]
paths:
- "docker/postgis/**"
release:
types: [published]
tags:
- postgis_*

jobs:
build:
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Docker Image (Build and Push)

on:
release:
types: [published]

jobs:
if: ${{ contains(github.ref, 'geoserver_') }}
geoserver:
runs-on: ubuntu-latest
steps:
- uses: winterjung/split@v2
id: split
with:
separator: "_"
msg: ${{ github.ref }}
- uses: ./.github/actions/build_and_push
with:
image: "geoserver"
branch: ${{ github.ref }}
tag: ${{ steps.split.outputs._1 }}
push: false

0 comments on commit d63dd51

Please sign in to comment.