Skip to content

Commit

Permalink
Github workflow to publish a docker image on a release
Browse files Browse the repository at this point in the history
  • Loading branch information
robvanmieghem committed Feb 22, 2023
1 parent b83083e commit 0de8e07
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/publish_container_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish Docker image

on:
release:
types: [published]

jobs:
build-and-push:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write

steps:
- name: Checkout the repo
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/threefoldtech/qsfs
tags: |
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
push: true
context: ./docker
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 0de8e07

Please sign in to comment.