feat(workspace): consolidated all workflow settings under single work… #58
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: Continuous Deployment | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
deployment: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Release Please Action | |
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 |