Skip to content

Commit

Permalink
ci: upload to releases
Browse files Browse the repository at this point in the history
  • Loading branch information
aeimer authored Jul 30, 2024
1 parent 1aaa62b commit 2e3c268
Showing 1 changed file with 35 additions and 39 deletions.
74 changes: 35 additions & 39 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,40 @@
name: Build and Deploy WAR

on:
push:
branches:
- master
push:
tags:
- 'v[0-9]+.[0-9]+'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up JDK 14
uses: actions/setup=java@v1
with:
java-version: 14

- name: Build WAR
run: jar cvf helloworld.war WEB-INF

- name: Display WAR file
run: ls helloworld.war

- name: Deploy WAR
run: |
mkdir -p deployment
cp helloworld.war deployment/
- name: Store WAR files in repo
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
mkdir -p war
cp helloworld.war war/
git add war
git commit -m "Add WAR file"
git push origin master


runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 14
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'

- name: Build WAR
run: jar cvf helloworld.war WEB-INF

- name: Display WAR file
run: ls helloworld.war

- name: Deploy WAR
run: |
mkdir -p deployment
cp helloworld.war deployment/
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: helloworld.war
asset_name: helloworld.war
tag: ${{ github.ref }}
overwrite: true
body: "HAve fun :)"

0 comments on commit 2e3c268

Please sign in to comment.