-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from metal-stack/upload-to-gcp
Upload the firewall-controller binary to images.metal-stack.io.
- Loading branch information
Showing
8 changed files
with
74 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,15 @@ on: | |
branches: | ||
- master | ||
|
||
env: | ||
GCS_BUCKET: images.metal-pod.io | ||
|
||
jobs: | ||
integration: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Go 1.16 | ||
uses: actions/[email protected] | ||
with: | ||
|
@@ -24,15 +28,23 @@ jobs: | |
sudo "PATH=$PATH" --preserve-env make test-all clean | ||
build: | ||
needs: integration | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: google-github-actions/setup-gcloud@master | ||
with: | ||
service_account_email: ${{ secrets.GCP_SA_EMAIL }} | ||
service_account_key: ${{ secrets.GCP_SA_KEY }} | ||
|
||
- name: Set up Go 1.16 | ||
uses: actions/[email protected] | ||
with: | ||
go-version: '1.16.x' | ||
|
||
- name: Make tag | ||
run: echo "TAG_NAME=$(echo $GITHUB_REF | awk -F / '{print $3}')-${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV | ||
|
||
- 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"' | ||
|
@@ -47,14 +59,17 @@ jobs: | |
|
||
- name: Build | ||
run: | | ||
make | ||
make fetch-template | ||
- name: Lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.32.2 | ||
args: --timeout=3m | ||
|
||
- name: Build | ||
run: | | ||
make | ||
- name: Build Docker Image | ||
run: | | ||
export GITHUB_TAG_NAME=${GITHUB_HEAD_REF##*/} | ||
|
@@ -65,3 +80,14 @@ jobs: | |
export GITHUB_TAG_NAME=${GITHUB_HEAD_REF##*/} | ||
make docker-push | ||
if: steps.fork.outputs.is_fork_pr == 'false' | ||
|
||
- name: Prepare upload | ||
run: | | ||
mkdir -p firewall-controller/pull-requests/${TAG_NAME} | ||
sudo chown -R $(id -u):$(id -g) bin | ||
mv bin/* firewall-controller/pull-requests/${TAG_NAME} | ||
if: steps.fork.outputs.is_fork_pr == 'false' | ||
|
||
- name: Upload image tarballs to GCS | ||
run: gsutil -m cp -r -p firewall-controller gs://$GCS_BUCKET | ||
if: steps.fork.outputs.is_fork_pr == 'false' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,9 @@ on: | |
types: | ||
- published | ||
|
||
env: | ||
GCS_BUCKET: images.metal-pod.io | ||
|
||
jobs: | ||
integration: | ||
runs-on: ubuntu-20.04 | ||
|
@@ -28,6 +31,12 @@ jobs: | |
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: google-github-actions/setup-gcloud@master | ||
with: | ||
service_account_email: ${{ secrets.GCP_SA_EMAIL }} | ||
service_account_key: ${{ secrets.GCP_SA_KEY }} | ||
|
||
- name: Set up Go 1.16 | ||
uses: actions/[email protected] | ||
with: | ||
|
@@ -48,14 +57,17 @@ jobs: | |
|
||
- name: Build | ||
run: | | ||
make | ||
make fetch-template | ||
- name: Lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.32.2 | ||
args: --timeout=3m | ||
|
||
- name: Build | ||
run: | | ||
make | ||
- name: Build and Push Docker Image | ||
run: | | ||
export GITHUB_TAG_NAME=${GITHUB_REF##*/} | ||
|
@@ -82,3 +94,12 @@ jobs: | |
asset_path: bin/firewall-controller.sha256 | ||
asset_name: firewall-controller.sha256 | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Prepare upload | ||
run: | | ||
mkdir -p firewall-controller/${GITHUB_TAG_NAME}/ | ||
sudo chown -R $(id -u):$(id -g) bin | ||
mv bin/* firewall-controller/${GITHUB_TAG_NAME}/ | ||
- name: Upload image tarballs to GCS | ||
run: gsutil -m cp -r -p firewall-controller gs://$GCS_BUCKET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters