Release 1.2.3.0 #69
Workflow file for this run
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: Publish PyPNM Image To GHCR | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| tag-check: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| is_on_main: ${{ steps.maincheck.outputs.is_on_main }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Validate tag is on main | |
| id: maincheck | |
| shell: bash | |
| run: | | |
| git fetch --no-tags origin main | |
| if git merge-base --is-ancestor "${GITHUB_SHA}" "origin/main"; then | |
| echo "is_on_main=true" >> "${GITHUB_OUTPUT}" | |
| else | |
| echo "is_on_main=false" >> "${GITHUB_OUTPUT}" | |
| fi | |
| build-and-push: | |
| needs: tag-check | |
| if: ${{ needs.tag-check.outputs.is_on_main == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata (tags, labels) | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ github.repository_owner }}/pypnm | |
| tags: | | |
| type=ref,event=tag | |
| type=raw,value=latest | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |