Merge pull request #767 from f5devcentral/dependabot/npm_and_yarn/api… #596
This file contains 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: Create and publish container images | |
on: | |
push: | |
branches: ["main"] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build-and-push-images: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for spa container | |
id: meta-spa | |
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-spa | |
tags: | | |
type=sha | |
type=raw,value=latest | |
- name: Build and push spa image | |
uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9 | |
with: | |
context: spa/. | |
push: true | |
tags: ${{ steps.meta-spa.outputs.tags }} | |
labels: ${{ steps.meta-spa.outputs.labels }} | |
- name: Extract metadata (tags, labels) for spa-dark container | |
id: meta-spa-dark | |
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-spa-dark | |
tags: | | |
type=sha | |
type=raw,value=latest | |
- name: Build and push spa-dark image | |
uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9 | |
with: | |
context: spa/. | |
build-args: | | |
VITE_APP_GLOBAL_COLOR=#FFF | |
VITE_APP_GLOBAL_BACKGROUND_COLOR=#000 | |
push: true | |
tags: ${{ steps.meta-spa-dark.outputs.tags }} | |
labels: ${{ steps.meta-spa-dark.outputs.labels }} | |
- name: Extract metadata (tags, labels) for api container | |
id: meta-api | |
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-api | |
tags: | | |
type=sha | |
type=raw,value=latest | |
- name: Build and push api image | |
uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9 | |
with: | |
context: api/. | |
push: true | |
tags: ${{ steps.meta-api.outputs.tags }} | |
labels: ${{ steps.meta-api.outputs.labels }} | |
- name: Extract metadata (tags, labels) for recommendations container | |
id: meta-recommendations | |
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-recommendations | |
tags: | | |
type=sha | |
type=raw,value=latest | |
- name: Build and push recommendations image | |
uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9 | |
with: | |
context: . | |
file: recommendations/Dockerfile | |
push: true | |
tags: ${{ steps.meta-recommendations.outputs.tags }} | |
labels: ${{ steps.meta-recommendations.outputs.labels }} | |
- name: Extract metadata (tags, labels) for inventory container | |
id: meta-inventory | |
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-inventory | |
tags: | | |
type=sha | |
type=raw,value=latest | |
- name: Build and push inventory image | |
uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9 | |
with: | |
context: inventory/. | |
push: true | |
tags: ${{ steps.meta-inventory.outputs.tags }} | |
labels: ${{ steps.meta-inventory.outputs.labels }} | |
- name: Extract metadata (tags, labels) for checkout container | |
id: meta-checkout | |
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-checkout | |
tags: | | |
type=sha | |
type=raw,value=latest | |
- name: Build and push checkout image | |
uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9 | |
with: | |
context: checkout/. | |
push: true | |
tags: ${{ steps.meta-checkout.outputs.tags }} | |
labels: ${{ steps.meta-checkout.outputs.labels }} |