violate the AGPL #110
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: Deploy Development Docker Images to GHCR | |
on: | |
push: | |
branches: | |
- "*" # matches every branch that doesn't contain a '/' | |
- "*/*" # matches every branch containing a single '/' | |
- "**" # matches every branch | |
- "!main" # excludes main | |
workflow_dispatch: | |
jobs: | |
push-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Make repo lowercase" | |
run: | | |
echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} | |
- name: Extract branch name | |
shell: bash | |
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" | sed 's/\//-/g' >> $GITHUB_OUTPUT | |
id: extract_branch | |
- name: "Checkout GitHub Action" | |
uses: actions/checkout@v4 | |
- name: "Login to GitHub Container Registry" | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{github.actor}} | |
password: ${{github.token}} | |
- name: "Build & Publish Docker Image" | |
run: | | |
docker build . --tag "ghcr.io/${REPO}:dev-${{ steps.extract_branch.outputs.branch }}" | |
docker push "ghcr.io/${REPO}:dev-${{ steps.extract_branch.outputs.branch }}" |