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

Remove rc release workflow, deploy to CloudRun #163

Merged
merged 1 commit into from
Sep 3, 2021
Merged
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
45 changes: 0 additions & 45 deletions .github/workflows/rc-release.yml

This file was deleted.

36 changes: 35 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@master
with:
python-version: '3.x'
Expand All @@ -25,18 +26,51 @@ jobs:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/

release-gcr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@master
with:
project_id: ${{ secrets.PROJECT_ID }}
service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
export_default_credentials: true
- name: Build Docker container and publish on GCR

- name: Check release version
id: check-tag
run: |
echo ::set-output name=version::$(echo ${{ github.event.ref }} | cut -d / -f 3 | cut -c2-)
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo ::set-output name=match::true
fi

- name: Build Docker container and publish on GCR [v*.*.*]
run: make cloudbuild
env:
GCR_PROJECT_ID: ${{ secrets.GCR_PROJECT_ID }}
CLOUDBUILD_PROJECT_ID: ${{ secrets.CLOUDBUILD_PROJECT_ID }}
VERSION: ${{ steps.check-tag.outputs.version }}

- name: Build Docker container and publish on GCR [latest]
run: make cloudbuild
if: ${{ steps.check-tag.outputs.match == 'true' }}
env:
GCR_PROJECT_ID: ${{ secrets.GCR_PROJECT_ID }}
CLOUDBUILD_PROJECT_ID: ${{ secrets.CLOUDBUILD_PROJECT_ID }}
VERSION: latest

- name: Deploy Docker container to Cloud Run
run: make cloudrun
if: ${{ steps.check-tag.outputs.match == 'true' }}
env:
GCR_PROJECT_ID: ${{ secrets.GCR_PROJECT_ID }}
CLOUDBUILD_PROJECT_ID: ${{ secrets.CLOUDBUILD_PROJECT_ID }}
CLOUDRUN_PROJECT_ID: ${{ secrets.CLOUDRUN_PROJECT_ID }}
VERSION: ${{ steps.check-tag.outputs.version }}
CONFIG_URL: gs://${{ secrets.CLOUDRUN_PROJECT_ID }}/config.yaml
SIGNATURE_TYPE: http
REGION: ${{ secrets.REGION }}
SERVICE_ACCOUNT: ${{ secrets.CLOUDRUN_SERVICE_ACCOUNT }}
2 changes: 1 addition & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ steps:
id: Build SLO generator
args: ['build', '-t', 'gcr.io/$_GCR_PROJECT_ID/slo-generator:${_VERSION}', '.']

- name: gcr.io/$_GCR_PROJECT_ID/slo-generator
- name: gcr.io/$_GCR_PROJECT_ID/slo-generator:${_VERSION}
id: Run all tests
entrypoint: make
env:
Expand Down