-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
46 lines (43 loc) · 1.56 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: "Deploy hugo to GCS"
author: "Filip Chyla"
branding:
icon: "upload-cloud"
color: "green"
description: "Deploy a multi-config hugo based website to a Google Cloud Storage bucket"
inputs:
deployment-target:
description: "target of hugo deploy command, [[deployment.targets]].name"
required: true
deployment-environment:
description: "build environment, which hugo configuration in config/ to use"
required: true
gcp-project-id:
description: "google cloud project id, used to generate application credentials during runtime"
required: true
gcp-service-account-key:
description: "service account key used for uploading to gcs"
required: true
gcp-create-credentials:
description: "export default credentials, if used you must run actions/checkout@v3 before this action"
required: true
runs:
using: "composite"
steps:
# Login to gcloud and export credentials
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v0'
with:
project_id: ${{ inputs.gcp-project-id }}
credentials_json: ${{ inputs.gcp-service-account-key }}
create_credentials_file: ${{ inputs.gcp-create-credentials }}
- name: Hugo setup
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "latest"
- name: Build
shell: bash
run: hugo --minify --environment ${{ inputs.deployment-environment }}
- name: Deploy
shell: bash
run: hugo deploy --target="${{ inputs.deployment-target }}" --environment ${{ inputs.deployment-environment }}