fix image push #85
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: Docker | |
| on: | |
| push: | |
| branches: ["master"] | |
| pull_request: | |
| branches: ["master"] | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Lowercase IMAGE_NAME | |
| run: echo "IMAGE_NAME=${IMAGE_NAME,,}" >> ${GITHUB_ENV} | |
| - name: Log into registry ${{ env.REGISTRY }} | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=ref,event=branch | |
| type=sha,format=short | |
| - name: Build and push core image | |
| uses: useblacksmith/build-push-action@v2 | |
| with: | |
| context: . | |
| file: Dockerfile.core | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-core:latest | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-core:master | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-core:${{ github.sha }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| - name: Build and push web image | |
| uses: useblacksmith/build-push-action@v2 | |
| with: | |
| context: . | |
| file: Dockerfile.web | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-web:latest | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-web:master | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-web:${{ github.sha }} | |
| labels: ${{ steps.meta.outputs.labels }} |