Merge pull request #1303 from wanglc02/patch-1 #18
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: containerize | |
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| REPO_PREFIX: ghcr.io/${{ github.repository }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: login-ghcr | |
| run: echo ${{ secrets.GHCR_PAT }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
| - name: build-docker-image | |
| run: | | |
| REPO_PREFIX_LOWER=$(echo "$REPO_PREFIX" | tr '[:upper:]' '[:lower:]') | |
| docker build -t $REPO_PREFIX_LOWER:${{ github.sha }} -f Dockerfile . | |
| docker push $REPO_PREFIX_LOWER:${{ github.sha }} | |
| docker tag $REPO_PREFIX_LOWER:${{ github.sha }} $REPO_PREFIX_LOWER:latest | |
| docker push $REPO_PREFIX_LOWER:latest |