Skip to content

Commit

Permalink
Publish to ghcr.io as well
Browse files Browse the repository at this point in the history
  • Loading branch information
loafoe committed Jun 5, 2023
1 parent 4988534 commit 9b6446f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,24 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to the Github Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
-
name: Build and push
id: docker_build
Expand All @@ -37,7 +48,8 @@ jobs:
file: ./docker/Dockerfile
platforms: linux/amd64
push: true
tags: philipslabs/cf-thanos:latest,docker.na1.hsdp.io/philipslabs/cf-thanos:latest
provenance: false
tags: philipslabs/cf-thanos:latest,docker.na1.hsdp.io/philipslabs/cf-thanos:latest,${{ steps.meta.outputs.tags }}
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
15 changes: 14 additions & 1 deletion .github/workflows/docker_tagged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,25 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Log in to the Github Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
- name: Set output
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
Expand All @@ -40,8 +52,9 @@ jobs:
context: ./docker
file: ./docker/Dockerfile
platforms: linux/amd64
provenance: false
push: true
tags: philipslabs/cf-thanos:${{ steps.vars.outputs.tag }},docker.na1.hsdp.io/philipslabs/cf-thanos:${{ steps.vars.outputs.tag }}
tags: philipslabs/cf-thanos:${{ steps.vars.outputs.tag }},docker.na1.hsdp.io/philipslabs/cf-thanos:${{ steps.vars.outputs.tag }},${{ steps.meta.outputs.tags }}
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

0 comments on commit 9b6446f

Please sign in to comment.