v0.8.1 #18
Workflow file for this run
This file contains hidden or 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
| name: Build STAC Browser | |
| on: | |
| release: | |
| types: [released] | |
| workflow_dispatch: | |
| inputs: | |
| TAG_NAME: | |
| description: "Tag name for this image" | |
| required: true | |
| default: "eoapi-k8s-stac-browser" | |
| STAC_BROWSER_VERSION: | |
| description: "STAC Browser version to build (e.g. v3.3.4)" | |
| required: true | |
| default: "v3.3.4" | |
| env: | |
| REGISTRY: ghcr.io | |
| TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| name: Build and push STAC Browser image | |
| steps: | |
| - name: Checkout STAC Browser repository | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: radiantearth/stac-browser | |
| ref: ${{ github.event.inputs.STAC_BROWSER_VERSION }} | |
| - name: Set environment variables | |
| run: | | |
| { | |
| echo "VERSION=${TAG_NAME#v}" | |
| echo "IMAGE_NAME=$REGISTRY/${GITHUB_REPOSITORY,,}/stac-browser" | |
| echo "COMMITED_AT=$(git show -s --format=%cI "$(git rev-parse HEAD)")" | |
| echo "REVISION=$(git rev-parse --short HEAD)" | |
| } >> "$GITHUB_ENV" | |
| - name: Collect Docker image metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.IMAGE_NAME }} | |
| labels: | | |
| org.opencontainers.image.created=${{ env.COMMITED_AT }} | |
| org.opencontainers.image.version=v${{ env.VERSION }} | |
| org.opencontainers.image.maintainer=${{ github.repository_owner }} | |
| tags: | | |
| type=semver,pattern={{version}},value=v${{ env.VERSION }} | |
| - name: Log in to the GitHub container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| build-args: | | |
| VERSION=${{ env.VERSION }} | |
| REVISION=${{ env.REVISION }} | |
| pathPrefix=/browser/ | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:edge | |
| cache-to: type=inline |