Skip to content

Commit

Permalink
Merge pull request #9 from metal-stack/move-to-ghcr
Browse files Browse the repository at this point in the history
Move to ghcr.
  • Loading branch information
majst01 authored Nov 23, 2020
2 parents 31ab3e2 + c8061a3 commit df5b27b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 9 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Docker Login
uses: docker/login-action@v1
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}

- name: Lint
uses: actions-contrib/golangci-lint@master
uses: golangci/golangci-lint-action@v2
with:
args: run --timeout 3m
version: v1.32.2
args: --timeout=3m

- name: Build
run: |
docker login -u ${{ secrets.DOCKER_HUB_USER }} -p ${{ secrets.DOCKER_HUB_TOKEN }}
make docker-image
make docker-push
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 22 additions & 3 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Figure out if running fork PR
id: fork
run: '["${{ secrets.DOCKER_REGISTRY_TOKEN }}" == ""] && echo "::set-output name=is_fork_pr::true" || echo "::set-output name=is_fork_pr::false"'

- name: Docker Login
uses: docker/login-action@v1
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
if: steps.fork.outputs.is_fork_pr == 'false'

- name: Lint
uses: actions-contrib/golangci-lint@master
uses: golangci/golangci-lint-action@v2
with:
args: run --timeout 3m
version: v1.32.2
args: --timeout=3m

- name: Build
run: |
export GITHUB_TAG_NAME=${GITHUB_HEAD_REF##*/}
docker login -u ${{ secrets.DOCKER_HUB_USER }} -p ${{ secrets.DOCKER_HUB_TOKEN }}
make docker-image
- name: Push
run: |
export GITHUB_TAG_NAME=${GITHUB_HEAD_REF##*/}
make docker-push
if: steps.fork.outputs.is_fork_pr == 'false'
14 changes: 12 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Docker Login
uses: docker/login-action@v1
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}

- name: Lint
uses: actions-contrib/golangci-lint@master
uses: golangci/golangci-lint-action@v2
with:
args: run --timeout 3m
version: v1.32.2
args: --timeout=3m

- name: Build
run: |
export GITHUB_TAG_NAME=${GITHUB_REF##*/}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

BINARY_PATH := bin/
COVERPROFILE := test/output/coverprofile.out
IMAGE_REPOSITORY := metalstack/machine-controller-manager-provider-metal
IMAGE_REPOSITORY := ghcr.io/metal-stack/machine-controller-manager-provider-metal
IMAGE_TAG := $(or ${GITHUB_TAG_NAME}, latest)
PROVIDER_NAME := MetalProvider
PROJECT_NAME := gardener
Expand Down

0 comments on commit df5b27b

Please sign in to comment.