Skip to content

Commit

Permalink
Fix Docker workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterdedroog committed Oct 3, 2023
1 parent 3e2d1a4 commit 1241ca3
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 55 deletions.
55 changes: 0 additions & 55 deletions .github/workflows/docker-image.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- 'main'
- 'feature/**'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -29,3 +33,48 @@ jobs:
with:
name: build-artifact
path: target/cookiebot-*.jar

docker:
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Docker buildx
uses: docker/[email protected]

- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: build-artifact
path: /srv/cookiebot/target/

- name: Build and push Docker image
id: build-and-push
uses: docker/[email protected]
with:
context: .
platforms: linux/amd64
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 1241ca3

Please sign in to comment.