Skip to content

Commit

Permalink
ci: add deployment pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
dymbe committed Jan 15, 2024
1 parent f8f16ff commit d6ac98e
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deployment

on:
workflow_dispatch:
push:
branches:
- main

permissions:
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
id-token: write
contents: read

jobs:
deploy:
name: Deploy to S3-bucket
environment:
name: test
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: package-lock.json

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.AWS_CD_ROLE }}
aws-region: eu-central-1

- name: Install dependencies
run: npm ci

- name: Export static website
run: npm run build

- name: Upload website to S3
run: aws s3 sync ./out ${{ vars.BUCKET_URL }} --delete

0 comments on commit d6ac98e

Please sign in to comment.