Skip to content

Commit

Permalink
Merge pull request #15 from meshcloud/feature/CU-85zrruq0d_resolve-de…
Browse files Browse the repository at this point in the history
…pendency-of-hubdockercom

Feature/cu 85zrruq0d resolve dependency of hubdockercom
  • Loading branch information
florianow committed Mar 22, 2023
2 parents 5297d5a + 029e8a7 commit 868acaf
Showing 1 changed file with 44 additions and 14 deletions.
58 changes: 44 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,51 @@ name: Automate dumptruck release
on:
release:
types: [published]


env:
REGISTRY: ghcr.io
IMAGE_NAME: dumptruck

jobs:
build:
name: Push Docker image to Docker Hub
name: Push Docker image to GitHub Container Registry
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
# This action will log in against a Docker registry.
- name: Login to DockerHub Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
# This action will Build and Push the latest Docker image to Docker Hub.
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: meshcloud/dumptruck:latest
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4
with:
context: dumptruck/
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 868acaf

Please sign in to comment.