Skip to content

Commit

Permalink
ci: publish images to ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
igboyes committed Nov 23, 2022
1 parent 0d2e3ec commit 0228614
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ on:
release:
types: [published]

env:
REGISTRY: ghcr.io

jobs:
dockerhub:
name: dockerhub
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -20,4 +23,32 @@ jobs:
uses: docker/build-push-action@v2
with:
push: true
tags: virtool/create-sample:${{ github.event.release.tag_name }}
tags: virtool/create-sample:${{ github.event.release.tag_name }}
ghcr:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
if: github.repository_owner == 'Virtool'
steps:
- uses: actions/checkout@v2
- uses: snok/install-poetry@v1
- name: Update Version
run: poetry version ${{github.event.release.tag_name}}
- uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.GH_USERNAME }}
password: ${{ secrets.GH_TOKEN }}
- name: Extract Metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/virtool/create-sample
- name: Build and Push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 0228614

Please sign in to comment.