Download .github/workflows/main.yml from laindsw/450: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/spaces/laindsw/450/resolve/main/.github/workflows/main.yml
- Command line
-
hf download hf://spaces/laindsw/450/.github/workflows/main.yml
-
curl -L -o main.yml https://huggingface.co/spaces/laindsw/450/resolve/main/.github/workflows/main.yml
1.14 kB
| name: GHCR CI | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: lowercase repository name | |
| run: echo "IMAGE_NAME=${GITHUB_REPOSITORY@L}" >> ${GITHUB_ENV} | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Read version from file | |
| id: version | |
| run: echo "VERSION=$(cat version.txt | grep version= | cut -d= -f2)" >> $GITHUB_OUTPUT | |
| - name: Log in to the GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| ghcr.io/${{ env.IMAGE_NAME }}:latest | |
| ghcr.io/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |