diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml deleted file mode 100644 index 8aa74bdc..00000000 --- a/.buildkite/pipeline.yml +++ /dev/null @@ -1,32 +0,0 @@ -# © 2019 Serokell -# © 2019 Lars Jellema -# -# SPDX-License-Identifier: MPL-2.0 - -env: - CDN_DISTRIBUTION_ID: E13UN1J1JFIWUZ - CDN_BUCKET: s3://nixfmt.serokell.io - -steps: - - label: reuse lint - commands: - - nix shell .#packages.x86_64-linux.reuse -c reuse lint - - label: nix-build - commands: - - nix build .#nixfmt-static | cachix push nixfmt - - nix build .#nixfmt-deriver | cachix push nixfmt - - label: build web demo - commands: - - set -o pipefail; nix build .#nixfmt-webdemo | cachix push nixfmt - - wait - - label: deploy web demo - branches: master - commands: - - 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 '/*' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..56eec721 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,42 @@ +# © 2019-2023 Serokell +# © 2019-2023 Lars Jellema +# +# SPDX-License-Identifier: MPL-2.0 + +name: CI +on: + pull_request: + push: + branches: + - master + +env: + CDN_DISTRIBUTION_ID: E13UN1J1JFIWUZ + CDN_BUCKET: s3://nixfmt.serokell.io + +jobs: + check: + runs-on: [self-hosted, nix] + steps: + - uses: actions/checkout@v3 + + - name: reuse lint + run: nix shell .#packages.x86_64-linux.reuse -c reuse lint + + - name: build + run: nix build .#nixfmt-static + if: success() || failure() + + deploy: + runs-on: [self-hosted, nix] + if: ${{ github.ref == 'refs/heads/master' }} + steps: + - uses: actions/checkout@v3 + + - 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 '/*'