Skip to content

Commit

Permalink
adding permissions for GHCR and Commenting out dockerhub login until …
Browse files Browse the repository at this point in the history
…we have credentials
  • Loading branch information
mayankchetan committed Apr 4, 2024
1 parent 2bc30e2 commit f08795d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/build-docker-image-automatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,29 @@ jobs:
DOCKERFILE_PATH: share/docker/Dockerfile
DOCKERHUB_REPOSITORY: nrel/openfast
GH_REGISTRY: ghcr.io/nrel/openfast
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Commenting out until we get the NREL DockerHub credentials
# - name: Log in to DockerHub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.GH_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract tag from release candidate branch name
id: extract-tag
Expand All @@ -51,8 +55,8 @@ jobs:
file: ${{ env.DOCKERFILE_PATH }}
platforms: linux/amd64,linux/aarch64
tags: |
${{ env.DOCKERHUB_REPOSITORY }}:${{ steps.extract-tag.outputs.openfast-tag }},${{ env.DOCKERHUB_REPOSITORY }}:latest
${{ env.GH_REGISTRY }}:${{ steps.extract-tag.outputs.openfast-tag }},${{ env.DOCKERHUB_REPOSITORY }}:latest
# ${{ env.DOCKERHUB_REPOSITORY }}:${{ steps.extract-tag.outputs.openfast-tag }},${{ env.DOCKERHUB_REPOSITORY }}:latest
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
16 changes: 10 additions & 6 deletions .github/workflows/build-docker-image-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/OpenFAST/openfast/main/share/docker/Dockerfile
DOCKERHUB_REPOSITORY: nrel/openfast
GH_REGISTRY: ghcr.io/nrel/openfast
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -32,11 +35,12 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Commenting out until we get the NREL DockerHub credentials
# - name: Log in to DockerHub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand All @@ -61,8 +65,8 @@ jobs:
file: ${{ env.DOCKERFILE_PATH }}
platforms: linux/amd64,linux/aarch64
tags: |
${{ env.DOCKERHUB_REPOSITORY }}:${{ github.event.inputs.tag }}
${{ env.GH_REGISTRY }}:${{ github.event.inputs.tag }}
# ${{ env.DOCKERHUB_REPOSITORY }}:${{ github.event.inputs.tag }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit f08795d

Please sign in to comment.