mirror of
https://github.com/furyhawk/api_gateway.git
synced 2026-07-21 02:06:50 +00:00
ci: publish container image to ghcr
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
name: Release Image
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract image metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=raw,value=latest
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
@@ -164,3 +164,14 @@ Example:
|
||||
make build CONTAINER_ENGINE=docker IMAGE_TAG=dev
|
||||
make run CONTAINER_ENGINE=docker PORT=8080 ENV_FILE=.env
|
||||
```
|
||||
|
||||
## GitHub Packages (GHCR)
|
||||
- Automated image publishing is configured in `.github/workflows/release-image.yml`.
|
||||
- On push of a release tag (for example `v0.2.0`), CI builds and pushes:
|
||||
- `ghcr.io/furyhawk/api_gateway:v0.2.0`
|
||||
- `ghcr.io/furyhawk/api_gateway:latest`
|
||||
|
||||
Pull example:
|
||||
```bash
|
||||
docker pull ghcr.io/furyhawk/api_gateway:v0.2.0
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user