Introduce Github Action #4
Workflow file for this run
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
name: deploy | |
on: push | |
env: | |
NIX_PATH: "nixpkgs=channel:nixos-unstable" | |
CDN_DISTRIBUTION_ID: "E37J93462NMI5V" | |
CDN_BUCKET: "s3://ghc.dev-prod" | |
jobs: | |
build: | |
runs-on: [self-hosted, nix] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: build | |
run: nix build | |
- name: deploy | |
# if: github.ref_name == 'master' | |
run: | | |
nix-shell -p awscli --run "aws s3 cp result/out $CDN_BUCKET/ --recursive" | |
echo +++ Invalidating cache | |
nix-shell -p awscli --run "aws cloudfront create-invalidation --distribution-id $CDN_DISTRIBUTION_ID --paths '/*'" |