Skip to content

Commit

Permalink
migrate to composite
Browse files Browse the repository at this point in the history
  • Loading branch information
zrosenbauer committed Jan 29, 2024
1 parent 8367f95 commit e24505a
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 17 deletions.
22 changes: 22 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#fef642",
"activityBar.background": "#fef642",
"activityBar.foreground": "#15202b",
"activityBar.inactiveForeground": "#15202b99",
"activityBarBadge.background": "#01beb6",
"activityBarBadge.foreground": "#15202b",
"commandCenter.border": "#15202b99",
"sash.hoverBorder": "#fef642",
"statusBar.background": "#fef30f",
"statusBar.foreground": "#15202b",
"statusBarItem.hoverBackground": "#d9cf01",
"statusBarItem.remoteBackground": "#fef30f",
"statusBarItem.remoteForeground": "#15202b",
"titleBar.activeBackground": "#fef30f",
"titleBar.activeForeground": "#15202b",
"titleBar.inactiveBackground": "#fef30f99",
"titleBar.inactiveForeground": "#15202b99"
},
"peacock.color": "#fef30f"
}
72 changes: 55 additions & 17 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,81 @@
name: Previews
description: Github Action used to deploy preview environments.
description: Github Action used to deploy preview environments, to Google Cloud Run.
author: "@joggrdocs"
branding:
icon: 'aperture'
color: 'blue'
inputs:
#------------------
# Deployment
#------------------

name:
description: "The name of the service (must be unique) to be deployed."
required: true
port:
description: "The port that the application will run on in the container."
required: false
default: "8080"
api_key:
description: "The API Key provided by BlueNova, used to associate all requests."
gcp_project_id:
description: "The GCP Project ID where the service will be deployed."
required: true
service_account_key:
description: "The Service Account JSON Key used to push images to the BlueNova Container Registry."
gcp_service_account_key:
description: "The Service Account JSON Key used to push images to the GCP Artifact Registry."
required: true
github_token:
description: "Github Token, pass in the secrets.GITHUB_TOKEN."
gcp_artifact_registry:
description: "The Artifact Registry name, you can override for custom names (i.e. us-docker.pkg.dev/able-sailor-21423/acme)"
required: true
directory:
description: "Directory where the DockerFile is located."
environment_variables:
description: "List of environment variables that will be injected during runtime, each on a new line."
required: false

#------------------
# Pull Request Integration
#------------------

github_token:
description: "Github Token, pass in the `secrets.GITHUB_TOKEN`."
required: true
default: "."

#------------------
# Docker
#------------------

dockerfile:
description: "The Dockerfile name, you can override for custom names (i.e. DevDockerfile)"
required: true
default: "Dockerfile"
build_args:
description: "Comma seperated list of arguments that will be injected during the build (i.e. FOO=bar,FOOBAR=foo)"
required: false
env_vars:
description: "Comma seperated list of environment variables that will be injected during runtime (i.e. FOO=bar,FOOBAR=foo)"
dockerfile_directory:
description: "Directory where the DockerFile is located."
required: true
default: "."
dockerfile_build_args:
description: "Comma separated list of arguments that will be injected during the build (i.e. FOO=bar,FOOBAR=foo)"
required: false
outputs:
url:
description: "The preview URL for the running application"
value: ${{ steps.deploy.outputs.url }}
runs:
using: node12
main: dist/index.js
using: "composite"
steps:
- name: '☁️ Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
project_id: ${{ inputs.gcp_project_id }}
credentials_json: '${{ inputs.gcp_service_account_key }}'

- name: '☁️ Setup Cloud SDK'
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ inputs.gcp_project_id }}

- name: '🐳 Authorize Docker push'
shell: bash
run: gcloud auth configure-docker us-docker.pkg.dev/durable-primacy-268722/intuscare --quiet

- name: '🐳 Build and Push Container'
shell: bash
run: |-
docker build -t gcr.io/${{ inputs.gcp_project_id }}/${{ inputs.name }}:${{ github.sha }} .
docker push gcr.io/${{ inputs.gcp_project_id }}/${{ inputs.name }}:${{ github.sha }}

0 comments on commit e24505a

Please sign in to comment.