Skip to content

Commit 0af9ecf

Browse files
authored
Merge pull request #1 from rocky-linux/fastly-compute
implement fastly compute-js
2 parents 3ddc766 + 0c453d6 commit 0af9ecf

File tree

9 files changed

+2511
-0
lines changed

9 files changed

+2511
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy AskNot-Rocky
2+
on:
3+
push:
4+
branches: [main]
5+
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
environment: Production
10+
steps:
11+
- uses: actions/checkout@v3
12+
13+
- name: Set up Fastly CLI
14+
uses: fastly/compute-actions/setup@v11
15+
with:
16+
token: ${{ secrets.GITHUB_TOKEN }}
17+
18+
- name: install dependencies
19+
run: npm install
20+
21+
- name: build site
22+
run: npm run build
23+
24+
- name: Build Compute Package
25+
uses: fastly/compute-actions/build@v11
26+
with:
27+
project_directory: compute-js
28+
29+
- name: Deploy Compute Package
30+
uses: fastly/compute-actions/deploy@v11
31+
with:
32+
project_directory: compute-js
33+
comment: "Deployed via GitHub Actions for ${{ github.head_ref }}.${{ github.sha }}"
34+
env:
35+
FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}
36+
37+
- name: Notify documentation channel about deployment Success
38+
uses: mattermost/action-mattermost-notify@master
39+
if: success() && !cancelled()
40+
with:
41+
MATTERMOST_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }}
42+
MATTERMOST_CHANNEL: web
43+
TEXT: |
44+
[Deployment](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) was completed :white_check_mark:
45+
MATTERMOST_USERNAME: "Github"
46+
47+
- name: Notify documentation channel about deployment Failure
48+
uses: mattermost/action-mattermost-notify@master
49+
if: failure() && !cancelled()
50+
with:
51+
MATTERMOST_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }}
52+
MATTERMOST_CHANNEL: web
53+
TEXT: |
54+
[Deployment](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed :x:
55+
MATTERMOST_USERNAME: "Github"

.github/workflows/preview.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Preview Pull Requests
2+
concurrency:
3+
group: ${{ github.head_ref || github.run_id }}-${{ github.workflow}}
4+
on:
5+
pull_request:
6+
types: [opened, synchronize, reopened, closed]
7+
jobs:
8+
deploy:
9+
environment: Preview
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
shell: bash
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: install dependencies
18+
run: npm install
19+
20+
- name: build site
21+
run: npm run build
22+
23+
- uses: fastly/compute-actions/preview@v11
24+
with:
25+
project_directory: compute-js
26+
fastly-api-token: ${{ secrets.FASTLY_API_KEY }}
27+
github-token: ${{ secrets.GITHUB_TOKEN }}

compute-js/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/node_modules
2+
/bin
3+
/pkg
4+
/static-publisher

compute-js/.publish-id

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Generated by @fastly/compute-js-static-publish.
2+
BSidIV3IYUe4tQ8ehUZfm

compute-js/fastly.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This file describes a Fastly Compute package. To learn more visit:
2+
# https://www.fastly.com/documentation/reference/compute/fastly-toml
3+
4+
authors = ["[email protected]"]
5+
description = "What Can I Do For Rocky Linux"
6+
language = "javascript"
7+
manifest_version = 2
8+
name = "asknot-rocky"
9+
service_id = "lir7oRwy5qHaRLRThrTql7"
10+
11+
[scripts]
12+
build = "npm run build"

0 commit comments

Comments
 (0)