Merge pull request #1 from EclipseFdn/add-charts #1
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: Docker Image CI (GHCR) | |
| # Only run this workflow on a push to the "master" branch | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| # Dynamically set the image name for GHCR | |
| env: | |
| IMAGE_NAME: ghcr.io/${{ github.repository }} | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| # grant write permissions for packages to the GITHUB_TOKEN | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| # This uses the env var: ghcr.io/your-username/your-repo-name | |
| images: ${{ env.IMAGE_NAME }} | |
| tags: | | |
| # Tag with 'latest' | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| # Tag with the 7-character Git SHA | |
| type=sha,prefix=,format=short | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| # This line uses the tags generated in the step above | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |