Skip to content

Commit

Permalink
Publish image to GitHub container registry
Browse files Browse the repository at this point in the history
  • Loading branch information
janvhs committed Sep 17, 2024
1 parent 6cf6816 commit e45f243
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,34 @@ jobs:
osc ar
osc commit -m "New development version of $NAME released"
github-release-container:
name: Release container to GitHub container registry
runs-on: ubuntu-20.04
if: github.ref == 'refs/heads/main' || github.event_name == 'release'
needs: [tlint]
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions-ecosystem/action-get-latest-tag@v1
id: latest-tag
with:
semver_only: true
initial_version: 0.0.1
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
push: true # Will only build if this is not here
tags: |
ghcr.io/${{ github.repository }}:{{ steps.latest-tag.outputs.tag }}
ghcr.io/${{ github.repository }}:latest

0 comments on commit e45f243

Please sign in to comment.