Skip to content

Commit

Permalink
Update build-push.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Twinki14 committed Jan 27, 2024
1 parent 37fc068 commit 642de6b
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/build-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,27 @@ jobs:
packages: write
steps:

- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- id: branch-name
- name: Checkout - Branch name
id: branch-name
uses: tj-actions/branch-names@v8

- uses: docker/setup-buildx-action@v3
- name: Setup - BuildX
uses: docker/setup-buildx-action@v3

- uses: docker/login-action@v3
- name: Login - Docker
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

# determine the global tag to append to the image, 'latest', 'edge', or 'cutting-edge'
# outputs 'date', 'tag' and 'custom-version'
- id: global-tag
- name: Docker - Determine tag
id: global-tag
run: |
is_tag="${{ env.IS-TAG }}"
is_default="${{ steps.branch-name.outputs.is_default }}"
Expand All @@ -49,7 +54,8 @@ jobs:
echo "custom-version=cutting-edge" >> "$GITHUB_OUTPUT"
fi
- id: meta
- name: Docker - Metadata
id: meta
uses: docker/metadata-action@v5
with:
flavor: latest=false
Expand All @@ -62,7 +68,8 @@ jobs:
# add global tag
type=raw,priority=700,value=${{ steps.global-tag.outputs.tag }}
- uses: docker/build-push-action@v5
- name: Docker - Build / Push
uses: docker/build-push-action@v5
with:
context: .
build-args: CUSTOM_VERSION=${{ steps.global-tag.outputs.custom-version }}
Expand All @@ -74,7 +81,8 @@ jobs:
cache-to: type=gha,mode=max

# Create a job summary that contains the pushed images
- run: |
- name: Docker - Image job summary
run: |
echo "## Pushed docker images :cloud:" >> $GITHUB_STEP_SUMMARY
tags="${{ steps.meta.outputs.tags }}"
Expand Down

0 comments on commit 642de6b

Please sign in to comment.