Skip to content

Commit

Permalink
Merge pull request #160 from NixOS/clean-ci
Browse files Browse the repository at this point in the history
ci: remove deploy and fix after repo transfer
  • Loading branch information
infinisil authored Mar 13, 2024
2 parents 4e2a748 + d5e91da commit 5d72795
Showing 1 changed file with 3 additions and 35 deletions.
38 changes: 3 additions & 35 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,17 @@ on:
branches:
- master

env:
CDN_DISTRIBUTION_ID: E13UN1J1JFIWUZ
CDN_BUCKET: s3://nixfmt.serokell.io

jobs:
check:
runs-on: [self-hosted, nix]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v26

- name: reuse lint
run: nix shell .#packages.x86_64-linux.reuse -c reuse lint

# - name: hlint
# run: nix build -L .#checks.x86_64-linux.hlint
# if: success() || failure()

# - name: stylish-haskell
# run: nix build -L .#checks.x86_64-linux.stylish-haskell
# if: success() || failure()

- name: build nixfmt
run: nix build -L .#nixfmt-static
if: success() || failure()

- name: build webdemo
run: nix build -L .#nixfmt-webdemo
if: success() || failure()

- name: build awscli
run: nix shell .#awscli
if: success() || failure()

deploy:
runs-on: [self-hosted, nix]
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v4

- name: deploy webdemo
run: |
nix build .#nixfmt-webdemo
nix shell .#awscli -c aws s3 cp --recursive result/ "$CDN_BUCKET"
# delete files that don't exist anymore, use `--size-only` so behavior won't depend on local file timestamps
nix shell .#awscli -c aws s3 sync --delete --size-only result/ "$CDN_BUCKET"
nix shell .#awscli -c aws cloudfront create-invalidation --distribution-id "$CDN_DISTRIBUTION_ID" --paths '/*'

0 comments on commit 5d72795

Please sign in to comment.