Skip to content

Commit

Permalink
website-deployment: introduce koyeb deployment and keep previous fast…
Browse files Browse the repository at this point in the history
…ly cache purge
  • Loading branch information
phaleth authored and terrablue committed Aug 6, 2024
1 parent 1b8a773 commit f44a46a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 5 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: koyeb.com deployment

on:
push:
branches: ["master"]

jobs:
deploy-website:
if: github.repository_owner == 'primatejs'
runs-on: ubuntu-latest

steps:
- name: Install Koyeb CLI
uses: koyeb-community/install-koyeb-cli@v2
with:
api_token: "${{ secrets.KOYEB_API_TOKEN }}"
- name: Build and deploy to Koyeb
uses: koyeb/action-git-deploy@v1
with:
app-name: "website"
service-name: "primate"
service-instance-type: "free"
service-regions: "fra"
service-ports: "6161:http"
service-routes: "/:6161"
skip-cache: true
git-workdir: "./"
git-branch: "master"
git-builder: "docker"
git-docker-dockerfile: "./packages/website/Dockerfile"
- name: "Purge Fastly cache"
run: |
curl -X POST -H "Fastly-Key: ${{ secrets.FASTLY_API_KEY }}" \
"https://api.fastly.com/service/${{ secrets.FASTLY_SERVICE_ID }}/purge_all"
12 changes: 7 additions & 5 deletions packages/website/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM denoland/deno:alpine
FROM node-alpine

COPY ./packages/website /app/website
COPY ./docs /app/website/components/content
WORKDIR /app

WORKDIR /app/website
COPY ./packages/website .
COPY ./docs ./components/content

CMD ["deno", "run", "--allow-all", "npm:primate", "serve"]
RUN npm i

CMD ["npx", "primate", "serve"]

0 comments on commit f44a46a

Please sign in to comment.