Skip to content

fix: replace driver dispose with quit #125

fix: replace driver dispose with quit

fix: replace driver dispose with quit #125

Workflow file for this run

name: Deploy to server
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '6.0.x' ]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Checkout submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet publish StudentsTimetable -c release -r ubuntu.21.04-x64 -p:PublishSingleFile=true --self-contained true --output StudentsTimetable/Artifacts
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3
with:
name: build
path: StudentsTimetable/Artifacts
upload:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '6.0.x' ]
steps:
- uses: actions/download-artifact@v2
name: Download build artifact
with:
name: build
path: StudentsTimetable/Artifacts
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: 'just-a-placeholder-so-we-dont-get-errors'
- name: Adding Known Hosts
run: ssh-keyscan -p 41061 -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
- name: Copy artifacts
uses: appleboy/scp-action@v0.1.4
with:
host: ${{ secrets.SSH_HOST }}
username: root
password: ${{ secrets.SSH_PASSWORD }}
port: 41061
source: "StudentsTimetable/Artifacts"
target: "/home/Students-Timetable/"
- name: Set up files in host
uses: appleboy/ssh-action@v0.1.10
with:
host: ${{ secrets.SSH_HOST }}
port: 41061
username: root
password: ${{ secrets.SSH_PASSWORD }}
script: "cd /home/Students-Timetable/StudentsTimetable/Artifacts && chmod +x StudentsTimetable && cd ./selenium-manager/linux && chmod +x selenium-manager && systemctl kill studentsservice"
publish:
needs: upload
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '6.0.x' ]
steps:
- uses: actions/download-artifact@v2
name: Download build artifact
with:
name: build
path: StudentsTimetable/Artifacts
- uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.ACCOUNT_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
- name: Archive files
run: |
cd StudentsTimetable/Artifacts
zip -r build.zip *
- name: Publish artifacts to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.ACCOUNT_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: StudentsTimetable/Artifacts/build.zip
asset_name: build.zip
asset_content_type: application/zip
- name: Cleanup
run: rm -rf ~/.ssh