Skip to content

Commit

Permalink
Cloudflare pages (#3)
Browse files Browse the repository at this point in the history
* updates test job names

* update workflows to use cloudflare pages for deployment

* increment version
  • Loading branch information
dpgraham4401 authored Mar 10, 2024
1 parent 6da600b commit 055e2ff
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-ghcr-image.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Build Image for GitHub Container Registry'
name: 'GHCR Image'
# This workflow will build a docker image, tag it, and push it to the GitHub Container Registry
# - It will name the image the same as the repository name

Expand All @@ -13,7 +13,7 @@ on:

jobs:
build_docker_image:
name: Build Image for GHCR
name: 'Build Image for GHCR'
runs-on: ubuntu-latest
permissions:
packages: write
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: 'Deploy'
name: 'Development Deployment'

# Requires the repo settings has the Pages source set to actions,
# and actions need to have write permissions for packages.

on:
release:
types: [ published ]
push:
branches:
- main

jobs:
deploy:
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 'Production Deployment'

on:
release:
types:
- published

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
environment:
name: production
url: ${{ steps.deployment.outputs.page_url }}
name: Publish to Cloudflare Pages
steps:
- name: 'Checkout'
uses: actions/checkout@v3

- name: 'Setup Node'
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- name: 'Install dependencies'
run: npm ci

- name: 'Build project'
run: npm run build

- name: 'Publish to Cloudflare Pages'
id: deployment
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ env.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ env.CLOUDFLARE_PROJECT_NAME }}
directory: ./build
# Required to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
VITE_MODE: 'TEST'

build:
name: 'Test Build'
name: 'Build'
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -60,7 +60,7 @@ jobs:
run: npm run build

test_image_builds:
name: 'Test Build Image'
name: 'Build Image'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vimpirate",
"version": "0.2.2",
"version": "0.2.3",
"private": true,
"scripts": {
"start": "vite",
Expand Down

0 comments on commit 055e2ff

Please sign in to comment.