GithubHelp home page GithubHelp logo

isabella232 / compute-actions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fastly/compute-actions

0.0 0.0 0.0 1.37 MB

GitHub Actions for building on Compute@Edge.

License: MIT License

JavaScript 100.00%

compute-actions's Introduction

GitHub Actions for Compute@Edge

This repository contains GitHub Actions to help you build on Fastly's Compute@Edge platform, such as installing the CLI, and building and deploying services.

IMPORTANT: Compute@Edge is currently in limited availability. For more information on what this means, read the Fastly product and feature lifecycle guide.

Usage

To compile and deploy a Compute@Edge service at the root of the repository, you can use the fastly/compute-actions main action. This will install the Fastly CLI, build your project, and deploy it to your Fastly service. If you used fastly compute init to initialise your project, this will work out of the box:

Cargo-based Workflow (Rust)

You will need to install the correct Rust toolchain for the action to build your project. The rust-toolchain action can handle this for you with the following configuration:

name: Deploy Application
on:
  push:
    branches: [master]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    - name: Install Rust toolchain
      uses: actions-rs/toolchain@v1
      with:
          toolchain: 1.54.0 # current Rust toolchain for Compute@Edge
          target: wasm32-wasi # WebAssembly target

    - name: Deploy to Compute@Edge
      uses: fastly/compute-actions@main
      env:
        FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}

npm-based Workflow (JavaScript + AssemblyScript)

GitHub Action runners come with a node toolchain pre-installed, so you can just run npm install to fetch your project's dependencies.

name: Deploy Application
on:
  push:
    branches: [master]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    - name: Install project dependencies
      run: npm install

    - name: Deploy to Compute@Edge
      uses: fastly/compute-actions@main
      env:
        FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}

Custom Workflows

Alternatively, you can manually run the individual GitHub Actions for Compute@Edge if you want finer control over your workflow:

name: Deploy Application
on:
  push:
    branches: [master]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1

    - name: Set up Fastly CLI
      uses: fastly/compute-actions/setup@main
      with:
        cli_version: '0.36.0' # optional, defaults to 'latest'

    - name: Install Dependencies
      run: npm install

    - name: Build Compute@Edge Package
      uses: fastly/compute-actions/build@main
      with:
        verbose: true # optionally enables verbose output, defaults to false
        skip_verification: true # optional, defaults to false

    - name: Deploy Compute@Edge Package
      uses: fastly/compute-actions/deploy@main
      with:
        service_id: '4tYGx...' # optional, defaults to value in fastly.toml
        comment: 'Deployed via GitHub Actions' # optional
      env:
        FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}

Security issues

Please see our SECURITY.md for guidance on reporting security-related issues.

License

The source and documentation for this project are released under the MIT License.

compute-actions's People

Contributors

kailan avatar phamann avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.