-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
21,933 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
name: Backend CI | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
RUSTFLAGS: -D warnings | ||
REGISTRY: ghcr.io | ||
RUST_VERSION: 1.70.0 | ||
|
||
jobs: | ||
cancel-previous-runs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/cancel-workflow-action@0.9.1 | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
cargo-fmt-check: | ||
needs: cancel-previous-runs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ env.RUST_VERSION }} | ||
- name: Check Formatting | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all --verbose -- --check | ||
|
||
cargo-clippy: | ||
needs: cancel-previous-runs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ env.RUST_VERSION }} | ||
- uses: Swatinem/rust-cache@v1 | ||
- name: Check Clippy Linter | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --all-features --all-targets -- -D warnings | ||
|
||
cargo-check: | ||
needs: cancel-previous-runs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: ${{ env.RUST_VERSION }} | ||
- uses: Swatinem/rust-cache@v1 | ||
- name: Run tests | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --verbose | ||
|
||
cargo-test: | ||
needs: cancel-previous-runs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: ${{ env.RUST_VERSION }} | ||
- uses: Swatinem/rust-cache@v1 | ||
- name: Run tests | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --verbose --all --all-features | ||
|
||
build-and-publish-image: | ||
needs: | ||
- cargo-fmt-check | ||
- cargo-clippy | ||
- cargo-check | ||
- cargo-test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: | | ||
ghcr.io/fuellabs/forc.pub | ||
tags: | | ||
type=ref,event=branch | ||
type=sha,prefix= | ||
type=semver,pattern={{raw}} | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Log in to the ghcr.io registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push the image to ghcr.io | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: deployment/Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
deploy: | ||
if: github.ref == 'refs/heads/master' | ||
needs: | ||
- build-and-publish-image | ||
runs-on: buildjet-4vcpu-ubuntu-2204 | ||
steps: | ||
- name: Set Environment Variables | ||
run: | | ||
tag=(`echo $GITHUB_SHA | cut -c1-7`) | ||
echo "IMAGE_TAG=`echo $tag`" >> $GITHUB_ENV | ||
- name: Deploy forc.pub Backend Environment | ||
uses: benc-uk/workflow-dispatch@v1 | ||
with: | ||
workflow: Deploy forc.pub on k8s | ||
repo: FuelLabs/fuel-deployment | ||
ref: refs/heads/master | ||
token: ${{ secrets.REPO_TOKEN }} | ||
inputs: '{ "cluster": "${{ env.CONFIG }}", "deployment-version": "${{ github.sha }}", "image-version": "${{ env.IMAGE_TAG }}" }' | ||
env: | ||
CONFIG: 'fuel-prod-1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Frontend - Build and Test | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- master | ||
|
||
env: | ||
NODE_VERSION: '16' | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: npm ci and build | ||
env: | ||
CI: true | ||
run: | | ||
cd app && npm ci && npm run build | ||
cp -r build ../build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
env: | ||
NODE_VERSION: '16' | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: npm ci and build | ||
env: | ||
CI: true | ||
run: | | ||
cd app && npm ci && npm run build | ||
cp -r build ../build | ||
cp ../CNAME ../build | ||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Build and publish Helm Chart | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- 'helm/forc.pub/Chart.yaml' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
helm-release: | ||
name: Build Helm Chart | ||
runs-on: buildjet-4vcpu-ubuntu-2204 | ||
if: | | ||
(github.event_name == 'release' && github.event.action == 'published') || | ||
github.ref == 'refs/heads/master' || github.event_name == 'pull_request' | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Package and Push Charts | ||
uses: bsord/helm-push@v4.1.0 | ||
with: | ||
useOCIRegistry: true | ||
registry-url: oci://ghcr.io/fuellabs/helmcharts | ||
username: ${{ github.repository_owner }} | ||
access-token: ${{ secrets.GITHUB_TOKEN }} | ||
force: true | ||
chart-folder: ./helm/forc.pub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,9 @@ | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
debug/ | ||
target/ | ||
|
||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries | ||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html | ||
Cargo.lock | ||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# MSVC Windows builds of rustc generate these, which store debugging information | ||
*.pdb | ||
/target | ||
out | ||
target | ||
.vercel | ||
/certs/* | ||
build | ||
node_modules | ||
tmp | ||
.vscode/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
forc.pub |
Oops, something went wrong.