Skip to content

Commit

Permalink
ci: Add docker push on release
Browse files Browse the repository at this point in the history
Signed-off-by: Woomymy <woomy@woomy.be>
  • Loading branch information
Woomymy committed Feb 1, 2023
1 parent 2568075 commit 112fa93
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ on:
push:
tags:
- '*'


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

jobs:
lint:
# Excute eslint & prettier
Expand Down Expand Up @@ -57,3 +61,35 @@ jobs:
release_name: Release ${{ steps.tag.outputs.tag }}
body_path: 'changelog.txt'
draft: false
build-and-push-image:
needs: ['compile', 'lint']
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

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

- name: Log in to the Container registry
uses: docker/#-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

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

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 112fa93

Please # to comment.