-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from Starfly-13/publish-docker-to-ghcr
Publish Docker Images to GitHub Container Registry
- Loading branch information
Showing
4 changed files
with
52 additions
and
2 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
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
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
publish: | ||
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') }} | ||
name: "Publish to GitHub Container Registry" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Project | ||
uses: actions/checkout@v3 | ||
|
||
- name: Docker Meta | ||
id: docker_meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
images: | | ||
ghcr.io/starfly-13/starfly-13 | ||
# add git short SHA as Docker tag | ||
tags: | | ||
# branch event | ||
type=ref,event=branch | ||
# pull request event | ||
type=ref,event=pr | ||
# full length sha | ||
type=sha,format=long | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
if: ${{ github.event_name != 'pull_request' }} | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Push Docker Image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
tags: ${{ steps.docker_meta.outputs.tags }} | ||
labels: ${{ steps.docker_meta.outputs.labels }} | ||
push: ${{ github.event_name != 'pull_request' }} |
File renamed without changes.