Skip to content

Commit

Permalink
add GitHub Container Registry
Browse files Browse the repository at this point in the history
  • Loading branch information
rwv committed Aug 11, 2021
1 parent 2fe4958 commit f51f03d
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ on:
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]

env:
IMAGE_NAME: seedgou/zerotier-moon

jobs:
build:

runs-on: ubuntu-latest

permissions:
contents: read
packages: write


steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand All @@ -27,20 +29,29 @@ jobs:
uses: docker/setup-buildx-action@v1

-
name: Login to DockerHub
name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

-
name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}


# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.IMAGE_NAME }}
images: seedgou/zerotier-moon,ghcr.io/seedgou/zerotier-moon

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
Expand Down

0 comments on commit f51f03d

Please sign in to comment.