Skip to content

Commit

Permalink
Merge pull request #1 from terraprompt/main
Browse files Browse the repository at this point in the history
Added workflow
  • Loading branch information
dipankar authored Oct 7, 2024
2 parents 1fc067b + e00dd9e commit 69f545b
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build & Deploy

on:
push:
branches: [ "prod" ]

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Create tarball of codebase
run: tar -cf deploy.tar --exclude=deploy.tar .

- name: Deploy App to CapRover
uses: caprover/deploy-from-github@v1.0.1
with:
server: '${{ secrets.CAPROVER_SERVER }}'
app: '${{ secrets.APP_NAME }}'
token: '${{ secrets.APP_TOKEN }}'
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#####################################################################
# Build Stage #
#####################################################################
FROM hugomods/hugo:exts as builder
# Build site
COPY . /src
# Replace below build command at will.
RUN hugo --minify --enableGitInfo
# Set the fallback 404 page if defaultContentLanguageInSubdir is enabled,
# please replace the `en` with your default language code.
# RUN cp ./public/en/404.html ./public/404.html

#####################################################################
# Final Stage #
#####################################################################
FROM hugomods/hugo:nginx
# Copy the generated files to keep the image as small as possible.
COPY --from=builder /src/public /site
4 changes: 4 additions & 0 deletions captain-definition
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"schemaVersion": 2,
"dockerfilePath": "./Dockerfile"
}

0 comments on commit 69f545b

Please sign in to comment.