Skip to content

fix(ci): publish only on tag #7

fix(ci): publish only on tag

fix(ci): publish only on tag #7

Workflow file for this run

name: Publish
on:
push:
tags:
- '*' # Trigger on any tag push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get versions
run: |
echo "NGINX_VERSION=$(grep -oP 'FROM docker.io/nginxinc/nginx-unprivileged:\K[0-9]+\.[0-9]+\.[0-9]+' Containerfile | head -n1)" >> $GITHUB_ENV
echo "VTS_VERSION=$(grep -oP 'nginx-module-vts/archive/refs/tags/v\K[0-9]+\.[0-9]+\.[0-9]+' Containerfile | head -n1)" >> $GITHUB_ENV
- uses: docker/build-push-action@v6
with:
context: .
file: ./Containerfile
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
ghcr.io/${{ github.repository }}:nginx-${{ env.NGINX_VERSION }}-vts-${{ env.VTS_VERSION }}
labels: |
org.opencontainers.image.source=${{ github.repositoryUrl }}
org.opencontainers.image.version=${{ env.NGINX_VERSION }}-${{ env.VTS_VERSION }}