Skip to content

Publish Docker image to GitHub Packages #1

Publish Docker image to GitHub Packages

Publish Docker image to GitHub Packages #1

Workflow file for this run

name: Publish Docker image to GitHub Packages
on:
release:
types: [published]
push:
branches:
- main
workflow_dispatch:
jobs:
publish-to-ghcr:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository_owner }}/etherproxy
tags: |
type=ref,event=tag
type=ref,event=branch
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}