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

fix(ci): Correctly pass secrets to the k8s-deployments composite actions #120

Merged
merged 1 commit into from
Jan 26, 2024
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
5 changes: 5 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ jobs:
- name: Call prepare release
if: startsWith(github.ref, 'refs/tags/v')
uses: ./.github/workflows/prepare-release.yml
with:
ARTIFACT_NAME: dre
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

########################################
# Upload container images
Expand All @@ -67,6 +70,8 @@ jobs:
- name: Update k8s deployments
if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.head_ref, 'container') || startsWith(github.ref, 'refs/heads/container') || (github.ref == 'refs/heads/main') }}
uses: ./.github/workflows/update-k8s-deployments
with:
gitlab_api_token: ${{ secrets.GITLAB_API_TOKEN }}

########################################
# Clean up runner
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/manage-runner-post/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ runs:
# Optimize bazel cache by hard-linking duplicate files
########################################
- name: Optimize bazel cache directory before uploading
if: ${{ github.ref == 'refs/heads/main' }}
run: ./bin/optimize-bazel-cache.sh
shell: bash

Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
required: true
description: "Name of the artifact to download"
type: string
GITHUB_TOKEN:
required: true
description: "GitHub token"
type: string

jobs:
prepare:
Expand All @@ -25,7 +29,7 @@ jobs:
# v0.1.15
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ inputs.GITHUB_TOKEN }}
body_path: CHANGELOG.md
generate_release_notes: true
draft: true
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/update-k8s-deployments/action.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: Update k8s deployments
description: Reusable action for updating k8s deployments

inputs:
gitlab_api_token:
description: 'A GitLab API token with access to the k8s repository'
required: true

runs:
using: composite
steps:
- env:
GITLAB_API_TOKEN: ${{ secrets.GITLAB_API_TOKEN }}
GITLAB_API_TOKEN: ${{ inputs.gitlab_api_token }}
shell: bash
run: |
set -eExou pipefail
Expand Down
Loading