Skip to content

Commit

Permalink
all the containers
Browse files Browse the repository at this point in the history
  • Loading branch information
zsteinkamp committed Mar 26, 2024
1 parent 9075d82 commit 492178c
Showing 1 changed file with 66 additions and 17 deletions.
83 changes: 66 additions & 17 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,33 +47,82 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
id: meta
## NGINX CONTAINER
- name: nginx Docker meta
id: nginx_meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
${{ env.REGISTRY }}/zsteinkamp/${{ env.IMAGE_BASE }}-nginx
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=branch
type=sha
# This step uses the `docker/build-push-action` action to build the
# image, based on your repository's `Dockerfile`. If the build succeeds,
# it pushes the image to GitHub Packages.
# It uses the `context` parameter to define the build's context as the
# set of files located in the specified path. For more information, see
# "[Usage](https://github.com/docker/build-push-action#usage)" in the
# README of the `docker/build-push-action` repository.
# It uses the `tags` and `labels` parameters to tag and label the image
# with the output from the "meta" step.
- name: Build and push Docker image
- name: nginx Build and push Docker image
uses: docker/build-push-action@v5
with:
file: ./Dockerfile.nginx
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.nginx_meta.outputs.tags }}
labels: ${{ steps.nginx_meta.outputs.labels }}

## API CONTAINER
- name: api Docker meta
id: api_meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/zsteinkamp/${{ env.IMAGE_BASE }}-api
tags: |
type=ref,event=branch
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: backend/
target: api
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.api_meta.outputs.tags }}
labels: ${{ steps.api_meta.outputs.labels }}

## WATCHER CONTAINER
- name: watcher Docker meta
id: watcher_meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/zsteinkamp/${{ env.IMAGE_BASE }}-watcher
tags: |
type=ref,event=branch
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: backend/
target: watcher
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.watcher_meta.outputs.tags }}
labels: ${{ steps.watcher_meta.outputs.labels }}

## ADMIN CONTAINER
- name: admin Docker meta
id: admin_meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/zsteinkamp/${{ env.IMAGE_BASE }}-admin
tags: |
type=ref,event=branch
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: backend/
target: admin
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.admin_meta.outputs.tags }}
labels: ${{ steps.admin_meta.outputs.labels }}

0 comments on commit 492178c

Please sign in to comment.