Added test, clean-up main init #7
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: Build and Push Docker image | |
| on: | |
| push: | |
| branches: [main] # Triggers when you push to the main branch | |
| workflow_dispatch: # Allows to be run manually from the GitHub UI | |
| jobs: | |
| docker: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # Needed to read the repo content | |
| packages: write # Needed to publish to GHCR (GitHub Container Registry) | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - 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 repository name | |
| id: meta | |
| run: echo "REPO=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV | |
| - name: Extract repository lowercase name | |
| id: repo_lowercase | |
| run: echo "REPO_LOWERCASE=${GITHUB_REPOSITORY@L}" >> $GITHUB_ENV # Print the repo as lowercase in env variables, needed for GHCR | |
| - name: Build and Push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./src | |
| push: true | |
| tags: ghcr.io/${{ env.REPO_LOWERCASE }}/frameweaver:latest |