Skip to content

Commit

Permalink
build: fix deps [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
xmlking committed Feb 24, 2024
1 parent 213f785 commit f4734fb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
inputs:
version:
description: Build with the given version.
default: v1.0.0
default: 0.1.0
required: true
app:
type: choice
Expand Down Expand Up @@ -81,6 +81,13 @@ jobs:
org.opencontainers.image.name=${{ env.IMAGE_NAME }}
org.opencontainers.image.title=${{ env.SCOPE }}
org.opencontainers.image.authors=Sumanth
tags: |
## only enabled for v* tags:
type=semver,pattern={{ version }},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
## only enabled on workflow_dispatch:
type=semver,pattern={{version}},prefix=v,value=${{ github.event.inputs.version }},enable=${{ github.event_name == 'workflow_dispatch' }}
## only enabled in main branch:
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
Expand Down
8 changes: 8 additions & 0 deletions docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,11 @@ Verify the image with Keyless mode
#nerdctl pull --verify=cosign ghcr.io/xmlking/spectacular:$VERSION
COSIGN_EXPERIMENTAL=1 cosign verify $DOCKER_IMAGE:$VERSION
```

### GitHub Action
Build environment variables are needed during docker build in `GitHub Action`
**TODO:** pass `GitHub Sectets` as described in `Reference` and [example 1](https://github.com/SSHOC/gl-autodevops-minimal-port/blob/main/.github/workflows/build-herokuish-and-push-to-registry.yaml#L95)

## Reference
- [Sharing environment variables using Github Action secrets](https://andrei-calazans.com/posts/2021-06-23-passing-secrets-github-actions-docker/)
- [How to use Github Action secrets with your Docker image](https://medium.com/@brian978_dev/effortlessly-secure-passing-secrets-from-github-to-your-docker-image-f1df3b6d0e49)

0 comments on commit f4734fb

Please sign in to comment.