Add billing target project ID to cost query service #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 and Push Container Image | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v5 | |
- name: Log in to Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=sha,prefix=sha- | |
- name: Setup Pack CLI | |
uses: buildpacks/github-actions/[email protected] | |
- name: Build with Cloud Native Buildpacks | |
run: | | |
pack build ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} | |
- name: Push image and additional tags | |
run: | | |
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} | |
for tag in $(echo '${{ steps.meta.outputs.tags }}' | tr '\n' ' '); do | |
if [ "$tag" != "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}" ]; then | |
docker tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} $tag | |
docker push $tag | |
fi | |
done |