Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: use docker/metadata-action #4421

Merged
merged 5 commits into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ name: Publish docker images
on:
push:
branches:
- '**'
- 'master'
tags:
- 'libp2p-server-**'
pull_request:

jobs:
server:
Expand All @@ -22,14 +23,17 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Get branch or tag name
id: ref-name
run: echo ::set-output name=ref::${GITHUB_REF#refs/*/}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}-server

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./misc/server/Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}-server:${{ steps.ref-name.outputs.ref }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}