Skip to content

Commit

Permalink
Refactor workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hibare committed Oct 22, 2023
1 parent ea7db21 commit 2122112
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 155 deletions.
74 changes: 0 additions & 74 deletions .github/workflows/docker-image-publish-nightly.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Master Release
name: Test, Dev Build & Release Publish

# When its time to do a release do a full cross platform build for all supported
# architectures and push all of them to Docker Hub & Github container registry.
Expand All @@ -7,6 +7,16 @@ on:
push:
tags:
- "*"
branches:
- dev

pull_request:
branches:
- "main"
- "dev"
paths-ignore:
- "**/README.md"
- "**/.github"

jobs:
docker-image-publish:
Expand All @@ -15,18 +25,38 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Set Docker Tags
id: set-docker-tags
run: |
DOCKER_TAGS="unknown"
if [ "${{ github.event_name }}" == "push" ] && [ "${{ github.ref }}" == "refs/heads/dev" ]; then
DOCKER_TAGS="dev"
else
DOCKER_TAGS="type=semver,pattern={{version}} type=semver,pattern={{major}}"
fi
echo "::set-output name=docker_tags::$DOCKER_TAGS"
shell: bash

- name: Set Docker Image Names
id: set-docker-image-names
run: |
if [ "${{ github.event_name }}" == "push" ] && [ "${{ github.ref }}" == "refs/heads/dev" ]; then
IMAGE_NAMES="hibare/moni"
else
IMAGE_NAMES="hibare/moni ghcr.io/hibare/moni"
fi
echo "::set-output name=docker_image_names::$IMAGE_NAMES"
shell: bash

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
hibare/moni
ghcr.io/hibare/moni
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}
images: ${{ steps.set-docker-image-names.outputs.docker_image_names}}
tags: ${{ steps.set-docker-tags.outputs.docker_tags }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand All @@ -53,6 +83,7 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
Expand Down
72 changes: 0 additions & 72 deletions .github/workflows/docker-image-test.yml

This file was deleted.

0 comments on commit 2122112

Please sign in to comment.