Skip to content

Commit

Permalink
Switch hosting to GitHub pages
Browse files Browse the repository at this point in the history
Fixes #58
Fixes #59
  • Loading branch information
cloudlena committed Apr 9, 2024
1 parent a1e94aa commit e7ee0a1
Show file tree
Hide file tree
Showing 14 changed files with 246 additions and 1,432 deletions.
51 changes: 28 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: Lint, Build and Deploy

on:
pull_request:
branches:
- main
push:
branches:
- main
pull_request:

jobs:
lint:
Expand All @@ -17,38 +15,45 @@ jobs:
uses: actions/setup-node@v4
- name: Checkout repo
uses: actions/checkout@v4
- name: Audit dependencies
run: npm audit
- name: Install dependencies
run: npm ci
- name: Check code
- name: Check
run: npm run check
- name: Lint code
- name: Lint
run: npm run lint

build:
name: Build and Deploy
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
name: Build
needs: lint
environment: aws-production
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
env:
AWS_REGION: eu-central-1
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
check-latest: true
- name: Set up OpenTofu
uses: opentofu/setup-opentofu@v1
- name: Checkout repo
uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Build application
- name: Build
run: npm run build
- name: Deploy to production
run: npm run deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./build

deploy:
name: Deploy
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:
- name: Configure Deployment
uses: actions/configure-pages@v4
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4
29 changes: 0 additions & 29 deletions infrastructure/.gitignore

This file was deleted.

20 changes: 0 additions & 20 deletions infrastructure/.terraform.lock.hcl

This file was deleted.

9 changes: 0 additions & 9 deletions infrastructure/.tflint.hcl

This file was deleted.

9 changes: 0 additions & 9 deletions infrastructure/Makefile

This file was deleted.

23 changes: 0 additions & 23 deletions infrastructure/dns.tf

This file was deleted.

11 changes: 0 additions & 11 deletions infrastructure/homepage.tf

This file was deleted.

19 changes: 0 additions & 19 deletions infrastructure/main.tf

This file was deleted.

Loading

0 comments on commit e7ee0a1

Please sign in to comment.