Enable writefreely #50
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
on: | |
pull_request: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- master | |
tags: | |
- "v?[0-9]+.[0-9]+.[0-9]+*" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
BuildPublish: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: "write" | |
contents: "read" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@main | |
with: | |
flakehub: true | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
with: | |
source-pr: 103 | |
use-gha-cache: false | |
- run: nix build .#nixosConfigurations.ethercalc-demo.config.system.build.toplevel | |
- uses: "DeterminateSystems/flakehub-push@main" | |
with: | |
name: "DeterminateSystems/demo" | |
rolling: true | |
visibility: "private" | |
include-output-paths: true | |
Deploy: | |
if: github.ref == 'refs/heads/main' | |
needs: BuildPublish | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: "write" | |
contents: "read" | |
steps: | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: us-east-2 | |
role-to-assume: arn:aws:iam::194722411868:role/github-actions/FlakeHubDeployDemo | |
- name: Deploy Ethercalc | |
run: | | |
aws ssm send-command \ | |
--region us-east-2 \ | |
--targets Key=tag:Name,Values=FlakeHubDemo \ | |
--document-name "FlakeHub-ApplyNixOS" \ | |
--parameters flakeref="DeterminateSystems/demo/0#nixosConfigurations.ethercalc-demo" | |
- name: Breakpoint if tests failed | |
if: failure() | |
uses: namespacelabs/breakpoint-action@v0 | |
with: | |
duration: 30m | |
authorized-users: grahamc |