Skip to content

Connect the ref from push to the publish #56

Connect the ref from push to the publish

Connect the ref from push to the publish #56

Workflow file for this run

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
outputs:
flakeref: ${{ steps.flakehubpush.outputs.flakeref }}
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"
id: flakehubpush
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="${{ needs.BuildPublish.outputs.flakeref }}#nixosConfigurations.ethercalc-demo"
- name: Breakpoint if tests failed
if: failure()
uses: namespacelabs/breakpoint-action@v0
with:
duration: 30m
authorized-users: grahamc