-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish image to GitHub container registry
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |