Remove ignored files #25
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
# .github/workflows/publish-nginx-container.yml | |
name: Build and Push NGINX container image to GHCR | |
on: | |
push: | |
branches: | |
- main # Trigger on pushes to the main branch | |
tags: | |
- 'v*.*.*' # Trigger on new tags like v1.0.0, v1.0.1, etc. | |
workflow_dispatch: # Allows manual triggering from the GitHub UI | |
env: | |
REGISTRY: ghcr.io | |
PROXY_IMAGE_NAME: ${{ github.repository }}-proxy | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write # Grant write permission to push to GHCR | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Extract metadata (tags, labels) for Docker | |
id: metaProxy | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.PROXY_IMAGE_NAME }} | |
tags: | | |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} | |
type=sha,format=short | |
type=ref,event=tag | |
- name: Build and Push Proxy Image | |
id: build-nginx-proxy | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./proxy | |
file: ./proxy/Dockerfile | |
push: true | |
tags: ${{ steps.metaProxy.outputs.tags }} | |
labels: ${{ steps.metaProxy.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Verify Pushed Images | |
run: | | |
echo "Proxy Image Pushed: ${{ env.REGISTRY }}/${{ env.PROXY_IMAGE_NAME }}:latest and ${{ github.sha }}" | |