Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(.github): Add docker build and push #8

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and Push Docker Image

on:
pull_request:

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
run: |
VERSION=$(git describe --exact-match 2> /dev/null || git describe --match=$(git rev-parse --short=8 HEAD) --always --dirty --abbrev=8)
make image
make push

env:
REGISTRY: rackspacengpc
11 changes: 8 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,13 @@ require (
sigs.k8s.io/yaml v1.3.0 // indirect
)

// To update the forked versions, execute the following commands:
// go mod edit -replace=github.com/gophercloud/gophercloud=github.com/platform9/gophercloud@master && go mod tidy
// go mod edit -replace=github.com/gophercloud/utils=github.com/platform9/gophercloud-utils@master && go mod tidy
// go mod edit -replace=k8s.io/cloud-provider=github.com/platform9/[email protected] && go mod tidy

replace (
github.com/gophercloud/gophercloud => ../gophercloud
github.com/gophercloud/utils => ../gophercloud-utils
k8s.io/cloud-provider => ../k8s-cloud-provider
github.com/gophercloud/gophercloud => github.com/platform9/gophercloud v0.0.0-20230725192123-f5bf8afaa214
github.com/gophercloud/utils => github.com/platform9/gophercloud-utils v0.0.0-20230725192416-bb0e57cadb96
k8s.io/cloud-provider => github.com/platform9/k8s-cloud-provider v0.0.0-20230630054839-fab92f8cbf80
)
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@ github.com/os-pc/gocloudlb v0.0.0-20210529010120-65b17b6d1ffa h1:1AqEZeYDKWyZrjA
github.com/os-pc/gocloudlb v0.0.0-20210529010120-65b17b6d1ffa/go.mod h1:vCN4JD8GTX/YkdqM3FVBtGBuHwJdC8ZRcJJHllq6qas=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/platform9/gophercloud v0.0.0-20230725192123-f5bf8afaa214 h1:bU1PqbNGTSunjQZ4UvRFuh2BwxHWNT7ov9oY2P3Ahc8=
github.com/platform9/gophercloud v0.0.0-20230725192123-f5bf8afaa214/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM=
github.com/platform9/gophercloud-utils v0.0.0-20230725192416-bb0e57cadb96 h1:9V8M13+vmuVDVmIcEXCknMTWUS9Gq0k40V3FXRwSPLU=
github.com/platform9/gophercloud-utils v0.0.0-20230725192416-bb0e57cadb96/go.mod h1:Qf8/V6MKkUzts4ma+TZEKLxRmS21iHi9raKDuet+d9Q=
github.com/platform9/k8s-cloud-provider v0.0.0-20230630054839-fab92f8cbf80 h1:RfGKZixkVyrqmn5T/y2F5uE/sX+Z2UeKbYipiphLiGo=
github.com/platform9/k8s-cloud-provider v0.0.0-20230630054839-fab92f8cbf80/go.mod h1:zIpLFNTyWQ7j7aC3DJ3NYFm0eOcD22OI9NUPBaiadso=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8=
Expand Down