go v bump #11
Workflow file for this run
This file contains hidden or 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: GHCR Dev | |
| on: | |
| pull_request: | |
| types: | |
| - closed | |
| branches: | |
| - "task/**" | |
| - "release/**" | |
| jobs: | |
| build: | |
| if: github.event.pull_request.merged == true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GHCR_TOKEN }} | |
| - name: Sanitize branch name for Docker tag | |
| id: branch | |
| run: | | |
| # Lowercases and replaces any non-alphanumeric chars (e.g. slashes) with '-' | |
| BRANCH="${{ github.head_ref }}" | |
| SANITIZED=$(echo "$BRANCH" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9._-]/-/g') | |
| echo "tag=$SANITIZED" >> $GITHUB_OUTPUT | |
| - name: Build and push Docker image | |
| run: | | |
| IMAGE_NAME=ghcr.io/damongolding/immich-kiosk-development | |
| TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ) | |
| VERSION="${{ steps.branch.outputs.tag }}" | |
| docker buildx build --build-arg VERSION=$VERSION \ | |
| --platform linux/amd64,linux/arm64 \ | |
| --push \ | |
| --label "org.opencontainers.image.created=$TIMESTAMP" \ | |
| --label "org.opencontainers.image.revision=${{ github.sha }}" \ | |
| --label "org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}" \ | |
| --label "org.opencontainers.image.version=$VERSION" \ | |
| --label "org.opencontainers.image.authors=${{ github.repository_owner }}" \ | |
| -t $IMAGE_NAME:$VERSION \ | |
| -t $IMAGE_NAME:latest \ | |
| . |