Skip to content

Commit

Permalink
chore(docker): push image to ghcr.io/{{repository_owner}}/godwoken
Browse files Browse the repository at this point in the history
  • Loading branch information
Flouse committed Dec 12, 2022
1 parent 691a3fa commit 1cf0357
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ${{ github.ref_type != 'tag' && 'ghcr.io/' || '' }}
REGISTRY: 'ghcr.io/'
# github.repository as <account>/<repo>
IMAGE_NAME: godwoken-prebuilds
IMAGE_NAME: godwoken


jobs:
Expand Down Expand Up @@ -66,8 +66,8 @@ jobs:
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.ref_type != 'tag' && github.repository_owner || secrets.DOCKERHUB_USERNAME }}
password: ${{ github.ref_type != 'tag' && secrets.GITHUB_TOKEN || secrets.DOCKERHUB_TOKEN }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Prepare components
id: prepare
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}${{ startsWith(github.ref, 'refs/tags') && github.repository_owner == 'godwokenrises' && 'nervos' || github.repository_owner }}/${{ env.IMAGE_NAME }}
images: ${{ env.REGISTRY }}${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
# dynamically set date as a suffix
tags: |
type=ref,event=tag
Expand All @@ -181,19 +181,6 @@ jobs:
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image to ${{ env.REGISTRY }}${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
if: ${{ github.ref_type != 'tag' }}
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

# Build and push Docker image with Buildx (don't push on PR)
# only for new tag
- name: Build and push Docker image to https://hub.docker.com/r/nervos/godwoken-prebuilds
if: ${{ github.repository_owner == 'godwokenrises' && startsWith(github.ref, 'refs/tags') }}
uses: docker/build-push-action@v3
with:
context: .
Expand Down

0 comments on commit 1cf0357

Please sign in to comment.