Skip to content

Commit

Permalink
CI: Modernize a bit (adding docker LABELs too)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoijui committed Nov 24, 2024
1 parent 273eb2e commit 980412b
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,50 @@
# SPDX-FileCopyrightText: 2021 Robin Vobruba <[email protected]>
# SPDX-FileCopyrightText: 2021-2024 Robin Vobruba <[email protected]>
#
# SPDX-License-Identifier: Unlicense

name: Publish Docker image

on:
push:
branches: [ master ]
release:
types: [published]

env:
IMAGE_NAME: hoijui/movedo

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Push to Docker Hub
uses: docker/build-push-action@v1
-
name: Checkout
uses: actions/checkout@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
fetch-depth: 0
fetch-tags: true
submodules: true
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: hoijui/movedo
tag_with_ref: true
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
-
name: Push to Docker Hub
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
#- name: Push to GitHub Packages
# uses: docker/build-push-action@v2
# with:
Expand Down

0 comments on commit 980412b

Please sign in to comment.