Skip to content

addign container publishing #1

addign container publishing

addign container publishing #1

name: Build and Publish Docker Image
on:
push:
branches:
- "**" # Trigger on push to any branch
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract branch name
id: extract_branch
run: echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Replace slashes in branch name
id: sanitize_branch
run: echo "sanitized_branch_name=${{ env.branch_name//\//- }}" >> $GITHUB_ENV

Check failure on line 32 in .github/workflows/nighlty-publish.yaml

View workflow run for this annotation

GitHub Actions / Build and Publish Docker Image

Invalid workflow file

The workflow is not valid. .github/workflows/nighlty-publish.yaml (Line: 32, Col: 14): Unexpected symbol: 'branch_name//\//-'. Located at position 5 within expression: env.branch_name//\//-
- name: Build and push Docker image
run: |
docker buildx build --push \
--tag ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:${{ env.sanitized_branch_name }}-nightly \
.
- name: Verify image
run: docker pull ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:${{ env.sanitized_branch_name }}-nightly