github.com/szkiba/xk6-dotenv@v0.2.0/.github/workflows/release.yml (about)

     1  name: Release
     2  on:
     3    push:
     4      tags:
     5        - "v*"
     6  
     7  jobs:
     8    release:
     9      name: Bundle xk6 extensions
    10      runs-on: ubuntu-latest
    11      permissions:
    12        contents: write
    13        packages: write
    14      env:
    15        REGISTRY: ghcr.io
    16        IMAGE_NAME: ${{ github.repository }}
    17  
    18      steps:
    19        - name: Checkout code
    20          uses: actions/checkout@v4
    21          with:
    22            fetch-depth: 0
    23  
    24        - name: Build
    25          id: build
    26          uses: szkiba/xk6bundler@v0
    27          with:
    28            with: github.com/szkiba/xk6-dotenv=/github/workspace
    29            k6_version: latest
    30  
    31        - name: Create Release
    32          uses: softprops/action-gh-release@v1
    33          with:
    34            files: dist/*.tar.gz
    35  
    36        - name: Log in to the Container registry
    37          uses: docker/login-action@v3
    38          with:
    39            registry: ${{ env.REGISTRY }}
    40            username: ${{ github.actor }}
    41            password: ${{ secrets.GITHUB_TOKEN }}
    42  
    43        - name: Extract metadata (tags, labels) for Docker
    44          id: meta
    45          uses: docker/metadata-action@v5
    46          with:
    47            images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
    48            tags: |
    49              type=semver,pattern={{version}}
    50              type=semver,pattern={{major}}.{{minor}}
    51              type=semver,pattern={{major}}
    52  
    53        - name: Build and push Docker image
    54          uses: docker/build-push-action@v5
    55          with:
    56            push: true
    57            context: ./${{ steps.build.outputs.dockerdir }}
    58            tags: ${{ steps.meta.outputs.tags }}
    59            labels: ${{ steps.meta.outputs.labels }}