Use custom SSH port for Github Actions #60
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: CI/CD | |
on: [push, pull_request] | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the source-code | |
uses: actions/checkout@v2 | |
- name: Setup (Nixpkgs config and NIXPKGS_COMMIT) | |
run: echo "NIXPKGS_COMMIT=$(curl -L 'https://channels.nixos.org/nixos-unstable/git-revision')" >> $GITHUB_ENV | |
- name: Install Nix | |
uses: cachix/install-nix-action@v12 | |
with: | |
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/${{ env.NIXPKGS_COMMIT }}.tar.gz | |
- name: Build the Anfibriefe | |
run: | | |
.github/scripts/gen-buildinfo.sh | |
nix-build --argstr date "$(date --date=@$(git log -1 --pretty=%ct) +%F)" --arg doCheck true | |
mkdir anfibrief && cp result/* .BUILDINFO anfibrief/ | |
- name: Upload the Anfibriefe (GitHub artifacts) | |
uses: actions/upload-artifact@v2 | |
with: | |
name: anfibrief | |
path: anfibrief/ | |
- name: Deploy the Anfibriefe | |
if: ${{ github.repository_owner == 'fsi-tue' && github.ref == 'refs/heads/master' }} | |
env: | |
SSH_KEY: ${{ secrets.SSH_KEY }} | |
SSH_PORT: ${{ secrets.SSH_PORT }} | |
run: .github/scripts/deploy.sh |