mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
57 lines
1.7 KiB
YAML
57 lines
1.7 KiB
YAML
name: Docker publish to docker.io
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- .github/workflows/docker-publish.yml
|
|
- .github/workflows/docker-publish.yml
|
|
- 'packages/**'
|
|
- 'docker-bin/**'
|
|
- 'package.json'
|
|
- 'pnpm-*.yaml'
|
|
- 'Dockerfile'
|
|
- '.dockerignore'
|
|
branches:
|
|
- 'master'
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
contents: read # to fetch code (actions/checkout)
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
if: github.repository == 'verdaccio/verdaccio'
|
|
steps:
|
|
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
|
- uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # tag=v1
|
|
- uses: docker/setup-buildx-action@v1
|
|
with:
|
|
driver-opts: network=host
|
|
- uses: docker/login-action@v1
|
|
name: Login Docker Hub
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
- name: Prepare docker image tags
|
|
id: docker_meta
|
|
uses: crazy-max/ghaction-docker-meta@v1
|
|
with:
|
|
images: ${{ github.repository }}
|
|
tag-custom: nightly-master
|
|
tag-custom-only: ${{ github.ref == 'refs/heads/master' }}
|
|
tag-latest: false
|
|
tag-semver: |
|
|
{{version}}
|
|
{{major}}
|
|
{{major}}.{{minor}}
|
|
- name: Build & Push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
tags: ${{ steps.docker_meta.outputs.tags }}
|
|
labels: ${{ steps.docker_meta.outputs.labels }}
|