Merge pull request #36 from tensorplex-labs/fix/pg-connections #48
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: Docker Build | |
on: | |
release: | |
types: | |
- published | |
push: | |
branches: | |
- dev | |
- staging | |
- main | |
jobs: | |
docker_publish: | |
name: Docker Build | |
runs-on: self-hosted | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Branch name | |
run: | | |
BRANCH_NAME=${GITHUB_REF#refs/heads/} | |
SANITIZED_BRANCH_NAME=${BRANCH_NAME//\//-} | |
echo "BRANCH_NAME=$SANITIZED_BRANCH_NAME" >> $GITHUB_ENV | |
- name: Build image with env tag | |
if: github.ref == 'refs/heads/dev' | |
|| github.ref == 'refs/heads/staging' | |
|| github.ref == 'refs/heads/main' | |
uses: macbre/push-to-ghcr@master | |
with: | |
image_name: ${{ github.repository }} | |
image_tag: ${{ env.BRANCH_NAME }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build image with semver tag | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: macbre/push-to-ghcr@master | |
with: | |
image_name: ${{ github.repository }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} |