Demo code for a talk on GitHub Actions delivered at SeaGL 2020.
- Install ASP.NET Core Runtime 3.1 for Linux
- Install rsync: (
sudo yum install -y rsync
in CentOS8) - Configure firewall to allow access to 80/tcp (CentOS8 commands below)
sudo firewall-cmd --zone=public --add-port 80/tcp --permanent
sudo firewall-cmd --reload
- Build and publish to the
published/
directory:dotnet publish --configuration Release --runtime centos.8-x64 --no-self-contained -o published src/Hello/Hello.csproj
- Export environment variables
DEPLOY_USER
andDEPLOY_HOST
(e.g.export DEPLOY_USER=root
andexport DEPLOY_HOST=<host IP address>
) - Deploy from the
published/
directory:deploy/deploy.sh published
(assumes SSH keys are configured)