-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37e3353
commit 9f69344
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Upload files to s3 | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
upload: | ||
description: "Choose from prod deploy or dry run" | ||
required: true | ||
default: "dry run" | ||
type: choice | ||
options: | ||
- prod | ||
- dry run | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
Deploy: | ||
name: Upload on s3 | ||
runs-on: ubuntu-latest | ||
environment: Deployment | ||
env: | ||
AWS_REGION: eu-central-1 | ||
|
||
steps: | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
role-to-assume: ${{ vars.AWS_ROLE_FOR_GITHUB_ACTIONS_GlOBAL }} | ||
role-session-name: githubrolesession | ||
aws-region: ${{ env.AWS_REGION }} | ||
mask-aws-account-id: 'no' | ||
|
||
- uses: actions/checkout@v2 | ||
- name: Upload on S3 | ||
run: | | ||
set -eo pipefail | ||
PRODRUN="${{ inputs.upload }}" | ||
BRANCH=${{ github.ref_name }} | ||
DEPLOY_PATH="" | ||
if [ "$BRANCH" != 'master' ]; then DEPLOY_PATH="/$BRANCH"; fi | ||
if [ "$PRODRUN" = 'prod' ]; then PRODRUN=''; else PRODRUN='--dryrun'; fi | ||
aws s3 sync server/docker s3://production.getfundwave.com$DEPLOY_PATH/docker --delete --exclude '**/changelog.txt' ${PRODRUN} |