Skip to content

Commit

Permalink
Remove GITOPS_TOKEN and use Staffbase/deploy-web-assets
Browse files Browse the repository at this point in the history
  • Loading branch information
m-seidel authored Feb 26, 2024
1 parent 5269e43 commit 23a2fec
Showing 1 changed file with 39 additions and 46 deletions.
85 changes: 39 additions & 46 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:

env:
NODE_VERSION: 16
DEPLOYMENT_KIND: widget
DEPLOYMENT_TARGET: weather
DEPLOYMENT_STATIC_FILES: staffbase.user-profile-client.min.js
DEPLOYMENT_SOURCE: samples/weather-forecast/dist


jobs:
build-and-deploy:
Expand Down Expand Up @@ -39,86 +44,74 @@ jobs:
mkdir samples/weather-forecast/icons
cp samples/weather-forecast/resources/weather-forecast.svg samples/weather-forecast/dist/icons
- uses: actions/checkout@v3
with:
persist-credentials: false
repository: Staffbase/S3-deployment-action
ref: 1.0.1
token: ${{ secrets.GITOPS_TOKEN }}
path: .github/gitops

- name: Publish to S3 DE Prod
if: github.event.release.tag_name != null
uses: ./.github/gitops
if: startsWith(github.ref, 'refs/tags/')
uses: Staffbase/[email protected]
with:
source: samples/weather-forecast/dist
destination: widgets/weather

source: ${{ env.DEPLOYMENT_SOURCE }}
target: ${{ env.DEPLOYMENT_TARGET }}
deployment_kind: ${{ env.DEPLOYMENT_KIND }}
# Varnish settings
static_files: |
manifest.json
frontend_host: frontend-cache-main-de1.staffbase.com
static_files: ${{ env.DEPLOYMENT_STATIC_FILES }}
frontend_cache_host: frontend-cache-main-de1.staffbase.com
frontend_cache_password: ${{ secrets.FRONTEND_CACHE_PROD_DE1_PASSWORD }}

# AWS specific settings
aws_bucket: staffbasestatic-prod-de1
aws_region: eu-central-1
aws_access_key: ${{ secrets.PROD_DE1_AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.PROD_DE1_AWS_ACCESS_KEY_SECRET }}
aws_access_key_id: ${{ secrets.PROD_DE1_aws_access_key_id_ID }}
aws_access_key_secret: ${{ secrets.PROD_DE1_aws_access_key_id_SECRET }}

- name: Deploy to S3 US Prod
if: github.event.release.tag_name != null
uses: ./.github/gitops
if: startsWith(github.ref, 'refs/tags/')
uses: Staffbase/[email protected]
with:
source: samples/weather-forecast/dist
destination: widgets/weather

source: ${{ env.DEPLOYMENT_SOURCE }}
target: ${{ env.DEPLOYMENT_TARGET }}
deployment_kind: ${{ env.DEPLOYMENT_KIND }}
# Varnish settings
static_files: |
manifest.json
frontend_host: frontend-cache-us1.staffbase.com
static_files: ${{ env.DEPLOYMENT_STATIC_FILES }}
frontend_cache_host: frontend-cache-us1.staffbase.com
frontend_cache_password: ${{ secrets.FRONTEND_CACHE_PROD_US1_PASSWORD }}

# AWS specific settings
aws_bucket: staffbasestatic-prod-us1
aws_region: us-east-1
aws_access_key: ${{ secrets.PROD_US1_AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.PROD_US1_AWS_ACCESS_KEY_SECRET }}
aws_access_key_id: ${{ secrets.PROD_US1_aws_access_key_id_ID }}
aws_access_key_secret: ${{ secrets.PROD_US1_aws_access_key_id_SECRET }}

- name: Publish to S3 DE stage
if: github.ref == 'refs/heads/main'
uses: ./.github/gitops
uses: Staffbase/[email protected]
with:
source: samples/weather-forecast/dist
destination: widgets/weather

source: ${{ env.DEPLOYMENT_SOURCE }}
target: ${{ env.DEPLOYMENT_TARGET }}
deployment_kind: ${{ env.DEPLOYMENT_KIND }}
# Varnish settings
static_files: |
manifest.json
frontend_host: frontend-cache-de1.staffbase.rocks
static_files: ${{ env.DEPLOYMENT_STATIC_FILES }}
frontend_cache_host: frontend-cache-de1.staffbase.rocks
frontend_cache_password: ${{ secrets.FRONTEND_CACHE_STAGE_DE1_PASSWORD }}

# AWS specific settings
aws_bucket: staffbasestatic-stage-de1
aws_region: eu-central-1
aws_access_key: ${{ secrets.STAGE_DE1_AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.STAGE_DE1_AWS_ACCESS_KEY_SECRET }}
aws_access_key_id: ${{ secrets.STAGE_DE1_aws_access_key_id_ID }}
aws_access_key_secret: ${{ secrets.STAGE_DE1_aws_access_key_id_SECRET }}

- name: Publish to S3 DE dev
if: github.ref == 'refs/heads/dev'
uses: ./.github/gitops
uses: Staffbase/[email protected]
with:
source: samples/weather-forecast/dist
destination: widgets/weather

source: ${{ env.DEPLOYMENT_SOURCE }}
target: ${{ env.DEPLOYMENT_TARGET }}
deployment_kind: ${{ env.DEPLOYMENT_KIND }}
# Varnish settings
static_files: |
manifest.json
frontend_host: frontend-cache-de1.staffbase.dev
static_files: ${{ env.DEPLOYMENT_STATIC_FILES }}
frontend_cache_host: frontend-cache-de1.staffbase.dev
frontend_cache_password: ${{ secrets.FRONTEND_CACHE_DEV_DE1_PASSWORD }}

# AWS specific settings
aws_bucket: staffbasestatic-dev-de1
aws_region: eu-central-1
aws_access_key: ${{ secrets.DEV_DE1_AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.DEV_DE1_AWS_ACCESS_KEY_SECRET }}
aws_access_key_id: ${{ secrets.DEV_DE1_aws_access_key_id_ID }}
aws_access_key_secret: ${{ secrets.DEV_DE1_aws_access_key_id_SECRET }}

0 comments on commit 23a2fec

Please sign in to comment.