Skip to content

Commit

Permalink
Feat/GitHub actions (#2)
Browse files Browse the repository at this point in the history
* Create docker-publish.yml
* Update README.md
* Update docker-publish.yml
  • Loading branch information
minostauros committed Nov 3, 2022
1 parent 0f62548 commit 698550e
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
66 changes: 66 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: build

on:
push:
branches:
- '**'
tags:
- '*.*.*'
pull_request:
branches:
- 'master'

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
# -
# name: Set up QEMU
# uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GIT_PACKAGES_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# duc-docker
[![Docker Automated build](https://img.shields.io/docker/automated/tigerdockermediocore/duc-docker.svg)](https://hub.docker.com/r/tigerdockermediocore/duc-docker) [![Docker Build Status](https://img.shields.io/docker/build/tigerdockermediocore/duc-docker.svg)](https://hub.docker.com/r/tigerdockermediocore/duc-docker)
![Docker Pulls](https://img.shields.io/docker/pulls/tigerdockermediocore/duc-docker) [![Automated build on Github Actions](https://github.com/minostauros/duc-docker/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/minostauros/duc-docker/pkgs/container/duc-docker)

Dockerized version of [duc](https://duc.zevv.nl), a disk usage analyzer.
See [docker hub](https://hub.docker.com/r/tigerdockermediocore/duc-docker/) to pull the images.
Expand Down

0 comments on commit 698550e

Please sign in to comment.