{"id":15046184,"url":"https://github.com/fastly/compute-actions","last_synced_at":"2025-04-09T12:05:51.890Z","repository":{"id":40686908,"uuid":"309684410","full_name":"fastly/compute-actions","owner":"fastly","description":"GitHub Actions for building on Fastly Compute.","archived":false,"fork":false,"pushed_at":"2025-03-24T18:25:19.000Z","size":2990,"stargazers_count":42,"open_issues_count":2,"forks_count":14,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-04-02T03:44:03.428Z","etag":null,"topics":["actions","fastly-oss-tier1","plugin","serverless"],"latest_commit_sha":null,"homepage":"https://www.fastly.com/blog/introducing-github-actions-for-compute-edge-a-new-resource-to-help-ship-code","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fastly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-03T12:47:40.000Z","updated_at":"2025-03-24T18:25:22.000Z","dependencies_parsed_at":"2023-02-09T11:31:52.663Z","dependency_job_id":"14e432be-6fcd-4d62-98dc-18531946416d","html_url":"https://github.com/fastly/compute-actions","commit_stats":{"total_commits":101,"total_committers":16,"mean_commits":6.3125,"dds":0.5544554455445545,"last_synced_commit":"738ba749cba872df127dd08dfe1d7ef774af1f67"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastly%2Fcompute-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastly%2Fcompute-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastly%2Fcompute-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastly%2Fcompute-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fastly","download_url":"https://codeload.github.com/fastly/compute-actions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036063,"owners_count":21037092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","fastly-oss-tier1","plugin","serverless"],"created_at":"2024-09-24T20:52:49.351Z","updated_at":"2025-04-09T12:05:51.869Z","avatar_url":"https://github.com/fastly.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Actions for Compute\n\nThis repository contains GitHub Actions to help you build on Fastly's Compute platform, such as installing the CLI, and building and deploying services.\n\n## Usage\n\nTo compile and deploy a Compute 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:\n\n### Cargo-based Workflow (Rust)\n\nYou will need to install the correct Rust toolchain for the action to build your project. The [rust-toolchain](https://github.com/marketplace/actions/rust-toolchain) action can handle this for you with the following configuration:\n\n```yml\nname: Deploy Application\non:\n  push:\n    branches: [main]\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v4\n\n    - name: Install Rust toolchain\n      uses: dtolnay/rust-toolchain@stable\n      with:\n          targets: wasm32-wasi # WebAssembly target\n\n    - name: Deploy to Compute\n      uses: fastly/compute-actions@v11\n      env:\n        FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}\n```\n\n### npm-based Workflow (JavaScript)\n\nGitHub Action runners come with a node toolchain pre-installed, so you can just run `npm ci` to fetch your project's dependencies.\n\n```yml\nname: Deploy Application\non:\n  push:\n    branches: [main]\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v4\n\n    - name: Install project dependencies\n      run: npm ci\n\n    - name: Deploy to Compute\n      uses: fastly/compute-actions@v11\n      env:\n        FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}\n```\n\n### go-based Workflow (Go)\n\nSince you need to pick Go version equal to 1.21 or later to build your Go project with GOARCH=wasm and GOOS=wasip1 target, it is recommended to use `actions/setup-go` with the following configuration, so that you can switch to any version of Go you need;\n\n```yml\nname: Deploy Application\non:\n  push:\n    branches: [main]\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v4\n\n    - name: Install Go toolchain\n      uses: actions/setup-go@v5\n      with:\n          go-version: \"1.23\"\n\n    - name: Deploy to the Compute platform\n      uses: fastly/compute-actions@v11\n      env:\n        FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}\n```\n\n### Custom Workflows\n\nAlternatively, you can manually run the individual GitHub Actions for Compute if you want finer control over your workflow:\n\n- [fastly/compute-actions/setup](setup/index.js) - Download the Fastly CLI if not already installed\n- [fastly/compute-actions/build](build/index.js) - Build a Compute project. Equivalent to `fastly compute build`\n- [fastly/compute-actions/deploy](deploy/index.js) - Deploy a Compute project. Equivalent to `fastly compute deploy`\n- [fastly/compute-actions/preview](preview/action.yml) - Deploy a Compute project to a new Fastly Service, which is deleted when the pull-request is merged or closed.\n\n#### Deploy to Fastly when push to `main`\n\n```yml\nname: Deploy Application\non:\n  push:\n    branches: [main]\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v4\n\n    - name: Set up Fastly CLI\n      uses: fastly/compute-actions/setup@v11\n      with:\n        cli_version: '1.0.0' # optional, defaults to 'latest'\n        token: ${{ secrets.GITHUB_TOKEN }}\n\n    - name: Install Dependencies\n      run: npm ci\n\n    - name: Build Compute Package\n      uses: fastly/compute-actions/build@v11\n      with:\n        verbose: true # optionally enables verbose output, defaults to false\n\n    - name: Deploy Compute Package\n      uses: fastly/compute-actions/deploy@v11\n      with:\n        service_id: '4tYGx...' # optional, defaults to value in fastly.toml\n        comment: 'Deployed via GitHub Actions' # optional\n      env:\n        FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}\n```\n\n#### Preview on Fastly for each pull-request\n\n```yml\nname: Fastly Compute Branch Previews\nconcurrency:\n  group: ${{ github.head_ref || github.run_id }}-${{ github.workflow}}\non:\n  pull_request:\n    types: [opened, synchronize, reopened, closed]\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        shell: bash\n    steps:\n      - uses: actions/checkout@v4\n      - uses: fastly/compute-actions/preview@v11\n        with:\n          fastly-api-token: ${{ secrets.FASTLY_API_KEY }}\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n```\n\n### Inputs\n\nThe following inputs can be used as `with` keys for the actions in this repository; none of them are required:\n\n- `project_directory` - Directory of the project to deploy, relative to the repository root.\n- `cli_version` - The version of the Fastly CLI to install, e.g. v0.20.0\n- `service_id` - The Fastly service ID to deploy to. Defaults to the value in `fastly.toml`. (deploy only)\n- `comment` - An optional comment to be included with the deployed service version. (deploy only)\n- `version` - Version to clone from when deploying. Can be \"latest\", \"active\", or the number of a specific version. (deploy only)\n- `verbose` - Set to true to enable verbose logging.\n- `token` - The GitHub token to use when interacting with the GitHub API.\n\n## Security issues\n\nPlease see our [SECURITY.md](SECURITY.md) for guidance on reporting security-related issues.\n\n## License\n\nThe source and documentation for this project are released under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastly%2Fcompute-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastly%2Fcompute-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastly%2Fcompute-actions/lists"}