ci: build & publish release image (#710) #1
This file contains 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
name: Publish | |
on: | |
push: | |
branches: [ main ] | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_TOOLCHAIN: nightly-2024-11-29 | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
# Add permission to push to GHCR | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push hyperion-proxy | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
target: hyperion-proxy | |
tags: | | |
${{ env.REGISTRY }}/${{ github.repository }}/hyperion-proxy:latest | |
${{ env.REGISTRY }}/${{ github.repository }}/hyperion-proxy:${{ github.sha }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Build and push tag | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
target: tag | |
tags: | | |
${{ env.REGISTRY }}/${{ github.repository }}/tag:latest | |
${{ env.REGISTRY }}/${{ github.repository }}/tag:${{ github.sha }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |