Skip to content

Commit

Permalink
Set version to v0.0.1:
Browse files Browse the repository at this point in the history
- update libs
- update readme
- update action.yml
  • Loading branch information
taraspos committed Dec 18, 2024
1 parent 606b252 commit cda336f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
1 change: 1 addition & 0 deletions tools/amplify-preview/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
TOOL_NAME = amplify-preview
VERSION = v0.0.1

include ../repo-release-tooling/tooling.mk
21 changes: 7 additions & 14 deletions tools/amplify-preview/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,37 +36,30 @@ on:
paths:
- 'docs/**'
workflow_dispatch:

permissions:
# Permissions to write PR comment
pull-requests: write
id-token: write

jobs:
amplify-preview:
name: Get and post Amplify preview URL
runs-on: ubuntu-22.04-2core-arm64
runs-on: ubuntu-latest
environment: docs-amplify
steps:
- name: Checkout shared-workflow
uses: actions/checkout@v4
with:
repository: gravitational/shared-workflows
sparse-checkout: |
tools

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4
with:
aws-region: us-west-2
role-to-assume: ${{ vars.IAM_ROLE }}

- name: Check Amplify job status test
uses: ./tools/amplify-preview
- name: Prepare Amplify Preview for this branch
uses: gravitational/shared-workflows/tools/amplify-preview@release/amplify-preview/v0.0.1
with:
app_ids: ${{ vars.AMPLIFY_APP_IDS }}
create_branches: "true"
# "create_branches" can be disabled if amplify branch auto discovery and auto build enabled
# https://docs.aws.amazon.com/amplify/latest/userguide/pattern-based-feature-branch-deployments.html
create_branches: "true"
github_token: ${{ secrets.GITHUB_TOKEN }}
# when "wait" is disabled, GHA won't wait for build to complete
wait: "true"
```
Expand Down
18 changes: 14 additions & 4 deletions tools/amplify-preview/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,25 @@ inputs:
runs:
using: composite
steps:
- name: Workaround go cache issue
shell: bash
run: |
# It seems like `setup-go` can't use for cache files outside of ${{ github.workspace }}
mkdir -p ${{ github.workspace }}/.tmp/actions/cache/amplify-preview
go_sum_path=${{ github.workspace }}/.tmp/actions/cache/amplify-preview/go.sum
cp ${{ github.action_path }}/go.sum ${{ github.workspace }}/.tmp/actions/cache/amplify-preview/
echo "go_sum_path=${go_sum_path}" >> $GITHUB_OUTPUT
id: cache_workaround

- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- uses: actions/setup-go@v5
with:
go-version-file: tools/amplify-preview/go.mod
cache-dependency-path: tools/amplify-preview/go.sum
go-version-file: ${{ github.action_path }}/go.mod
cache-dependency-path: ${{ steps.cache_workaround.outputs.go_sum_path }}

- name: Amplify Preview
env:
Expand All @@ -35,5 +45,5 @@ runs:
GITHUB_TOKEN: ${{ inputs.github_token }}
WAIT: ${{ inputs.wait }}
shell: bash
run: |
pushd ./tools/amplify-preview/; go run ./; popd
working-directory: ${{ github.action_path }}
run: go run .
4 changes: 1 addition & 3 deletions tools/amplify-preview/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/aws/aws-sdk-go-v2 v1.32.6
github.com/aws/aws-sdk-go-v2/config v1.28.6
github.com/aws/aws-sdk-go-v2/service/amplify v1.27.5
github.com/gravitational/shared-workflows/libs v0.1.3
github.com/gravitational/shared-workflows/libs v0.1.4
)

require (
Expand All @@ -33,5 +33,3 @@ require (
golang.org/x/oauth2 v0.21.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/gravitational/shared-workflows/libs => ../../libs/
2 changes: 2 additions & 0 deletions tools/amplify-preview/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,8 @@ github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57Q
github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI=
github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
github.com/gravitational/shared-workflows/libs v0.1.4 h1:PW5xkoh5r+OKCFG9JwJkcCu5gKK41stQtnUBfhNKpaI=
github.com/gravitational/shared-workflows/libs v0.1.4/go.mod h1:hzF3OgNdM/Mrgovq++B3ZymG58p54Ccjb8sbPZGfp08=
github.com/gravitational/trace v1.4.0 h1:TtTeMElVwMX21Udb1nmK2tpWYAAMJoyjevzKOaxIFZQ=
github.com/gravitational/trace v1.4.0/go.mod h1:g79NZzwCjWS/VVubYowaFAQsTjVTohGi0hFbIWSyGoY=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
Expand Down

0 comments on commit cda336f

Please sign in to comment.