Skip to content

Commit

Permalink
feat(github-actions): added deployment action to publish docker conta…
Browse files Browse the repository at this point in the history
…iners
  • Loading branch information
shinybrar committed Jun 12, 2024
1 parent 644a744 commit 1c5d71c
Showing 1 changed file with 54 additions and 1 deletion.
55 changes: 54 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,61 @@ jobs:
steps:
-
name: Release Please Action
id: release
id: release-please
uses: googleapis/[email protected]
with:
release-type: python
manifest-file: .release-please-manifest.json
-
name: Checkout buckets code
if: ${{ steps.release-please.outputs.release_created }}
uses: actions/checkout@v3
with:
fetch-depth: 1
-
name: Create release tags
id: metadata
if: ${{ steps.release-please.outputs.release_created }}
run: |
echo "Creating release tags for docker image"
IMAGE="chimefrb/workflow"
TAG=${{ steps.release-please.outputs.tag_name }}
echo "image=${IMAGE}:latest" >> $GITHUB_OUTPUT
echo "tagged_image=${IMAGE}:${TAG}" >> $GITHUB_OUTPUT
-
name: Setup ssh-agent
id: ssh-agent-setup
if: ${{ steps.release-please.outputs.release_created }}
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.CHIMEFRB_BOT_SSH_PRIVATE_KEY }}
-
name: Setup docker-buildx
id: buildx
if: ${{ steps.release-please.outputs.release_created }}
uses: docker/setup-buildx-action@v1
with:
install: true
-
name: Perform docker-login
if: ${{ steps.release-please.outputs.release_created }}
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build & Push docker image
id: build
if: ${{ steps.release-please.outputs.release_created }}
uses: docker/build-push-action@v2
with:
context: .
target: production
file: Dockerfile
platforms: linux/amd64,linux/arm64
tags: |
${{ steps.metadata.outputs.image }}
${{ steps.metadata.outputs.tagged_image }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 1c5d71c

Please sign in to comment.