Skip to content

feat(docker): added entrypoint to optionally run workspace set #109

feat(docker): added entrypoint to optionally run workspace set

feat(docker): added entrypoint to optionally run workspace set #109

Workflow file for this run

name: Continuous Deployment
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
packages: write
attestations: write
id-token: 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"
GHCR_IMAGE="ghcr.io/chimefrb/workflow"
TAG=${{ steps.release-please.outputs.tag_name }}
echo "image=${IMAGE}:latest" >> $GITHUB_OUTPUT
echo "tagged_image=${IMAGE}:${TAG}" >> $GITHUB_OUTPUT
echo "ghcr_image=${GHCR_IMAGE}:latest" >> $GITHUB_OUTPUT
echo "ghcr_tagged_image=${GHCR_IMAGE}:${TAG}" >> $GITHUB_OUTPUT
-
name: Setup docker-buildx
id: buildx
if: ${{ steps.release-please.outputs.release_created }}
uses: docker/setup-buildx-action@v3
with:
install: true
-
name: Perform DockerHub Login
if: ${{ steps.release-please.outputs.release_created }}
uses: docker/login-action@v3
with:
username: ${{ secrets.CHIMEFRB_DOCKER_USERNAME }}
password: ${{ secrets.CHIMEFRB_DOCKER_PASSWORD }}
-
name: Perform GHCR Login
if: ${{ steps.release-please.outputs.release_created }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
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 }}
${{ steps.metadata.outputs.ghcr_image }}
${{ steps.metadata.outputs.ghcr_tagged_image }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
-
name: Install Poetry
if: ${{ steps.release-please.outputs.release_created }}
run: |
pipx install poetry
-
name: Setup Python
if: ${{ steps.release-please.outputs.release_created }}
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: poetry
-
name: Push to PyPI
if: ${{ steps.release-please.outputs.release_created }}
env:
WORKFLOW_PYPI_TOKEN: ${{ secrets.WORKFLOW_CORE_PYPI_TOKEN }}
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project false
poetry install
poetry config pypi-token.pypi $WORKFLOW_PYPI_TOKEN
poetry publish --build --verbose