Skip to content

Commit

Permalink
Fix docker build and push
Browse files Browse the repository at this point in the history
  • Loading branch information
AtomicMegaNerd committed Dec 24, 2024
1 parent ff4f140 commit 49c3ca4
Showing 1 changed file with 31 additions and 12 deletions.
43 changes: 31 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches:
- main

env:
REGISTRY: ghcr.io

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -44,24 +47,40 @@ jobs:
- name: Run lints
run: task lint


publish_docker_image:
runs-on: ubuntu-latest
name: Build and Publish Docker image
needs: build
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
steps:

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: atomicmeganerd/starfeed
tags: ${{ env.VERSION }},latest
- name: Login to Docker
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/atomicmeganerd/starfeed
tags: |
latest
${{ env.VERSION }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}

tag_and_release:
runs-on: ubuntu-latest
name: Tag and create release
needs: publish_docker_image
steps:
- name: Create Git tag
run: git tag ${{ env.VERSION }} && git push origin ${{ env.VERSION }}
env:
Expand Down

0 comments on commit 49c3ca4

Please sign in to comment.