Skip to content

ci: pin GitHub Actions to SHA digests (#13) #41

ci: pin GitHub Actions to SHA digests (#13)

ci: pin GitHub Actions to SHA digests (#13) #41

# .github/workflows/docker-publish.yml
name: Build and Push Docker Images to GHCR
on:
push:
branches:
- main
- helm-chart
jobs:
build-and-push-api:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Log in to the Container registry
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for API
id: meta-api
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5
with:
images: ghcr.io/developmentseed/geodini/api
tags: |
type=sha
type=raw,value=latest
- name: Build and push API image
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta-api.outputs.tags }}
labels: ${{ steps.meta-api.outputs.labels }}