-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(github-actions): added deployment action to publish docker conta…
…iners
- Loading branch information
Showing
1 changed file
with
54 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |