-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
88 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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Docker Image Latest | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
|
||
|
||
jobs: | ||
|
||
build-and-publish-latest: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' # Running this job only for main branch | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: downcase github.repository | ||
run: | | ||
echo "IMAGE_NAME=`echo ${{github.repository}} | tr '[:upper:]' '[:lower:]'`" >>${GITHUB_ENV} | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
# - name: Build and push Docker image | ||
# uses: docker/build-push-action@v5 | ||
# with: | ||
# context: . | ||
# push: true | ||
# tags: ${{ steps.meta.outputs.tags }} | ||
# labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Build and push Docker image Latest | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
labels: ${{ steps.meta.outputs.labels }} | ||
tags: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" |
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,26 @@ | ||
name: Manual | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
print-name: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Dump github context | ||
run: echo "$GITHUB_CONTEXT" | ||
shell: bash | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
- name: get-name | ||
run: | | ||
echo "REPO_NAME=$(basename ${{ github.repository }})" >> $GITHUB_ENV | ||
- name: print-REPO_NAME | ||
run: | | ||
echo "${{ env.REPO_NAME }}" | ||
- name: downcase github.repository | ||
run: | | ||
echo "IMAGE_NAME=`echo ${{github.repository}} | tr '[:upper:]' '[:lower:]'`" >>${GITHUB_ENV} | ||
- name: print-IMAGE_NAME | ||
run: | | ||
echo "${{ env.IMAGE_NAME }}" |