Final touches #100
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 to EC2 | |
on: | |
push: | |
branches: [dev] #[dev-ops/minor-fixes] | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: self-hosted | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.17.1 | |
- name: Install frontend dependencies | |
run: npm install | |
working-directory: frontend/infosafe_frontend | |
- name: Build frontend | |
run: npm run build | |
working-directory: frontend/infosafe_frontend | |
env: | |
CI: false | |
- name: Set up JDK 20 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '20' | |
distribution: 'temurin' | |
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml | |
settings-path: ${{ github.workspace }} # location for the settings.xml file | |
- name: Kill current process on backend port | |
run: sudo kill -9 $(sudo lsof -t -i:8080) & | |
- name: Build backend | |
run: mvn -B package --file backend/infosafe_backend/pom.xml | |
- name: Execute backend | |
run: sudo java -jar /home/ubuntu/actions-runner/_work/InfoSafe/InfoSafe/backend/infosafe_backend/target/infosafe_backend-0.0.1-SNAPSHOT.jar & | |
# - name: Publish to GitHub Packages Apache Maven | |
# run: | | |
# cd /home/ubuntu/actions-runner/_work/InfoSafe/InfoSafe/backend/infosafe_backend | |
# mvn deploy -s $GITHUB_WORKSPACE/settings.xml | |
# env: | |
# GITHUB_TOKEN: ${{ github.token }} |