Skip to content

Commit

Permalink
chore: add cd workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Lam Tran <[email protected]>
  • Loading branch information
tranngoclam authored and Lam Tran committed Nov 14, 2023
1 parent 46b90d7 commit 6ed3d06
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Continuous Deployment

on:
push:
branches:
- "**"

jobs:
cd:
name: Build Container Image
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0

- name: Docker meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.5.0
id: meta
with:
images: |
ghcr.io/tranngoclam/monorepo-foo
tags: |
type=sha,enable=true,suffix=-amd64,format=long
type=sha,enable=true,suffix=-arm64,format=long
type=raw,enable=true,prefix=latest,suffix=-amd64
type=raw,enable=true,prefix=latest,suffix=-arm64
- name: Build/Tag/Push Docker Image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
file: foo/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Create and push manifest images
run: |
docker buildx imagetools create \
--tag ghcr.io/tranngoclam/monorepo-foo:latest \
ghcr.io/tranngoclam/monorepo-foo:latest-amd64 \
ghcr.io/tranngoclam/monorepo-foo:latest-arm64

0 comments on commit 6ed3d06

Please sign in to comment.