Skip to content

Commit

Permalink
Update gradle-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
thalals authored Feb 15, 2024
1 parent d4f9f20 commit b18de94
Showing 1 changed file with 30 additions and 46 deletions.
76 changes: 30 additions & 46 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,66 +12,50 @@ on:
push:
branches:
- main
env:
working-directory: ./

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.working-directory }}
permissions:
contents: read
packages: write

steps:
- name: CheckOut
uses: actions/checkout@v4
with:
token: ${{ secrets.ACTION_TOKEN }}
submodules: true
- name: CheckOut
uses: actions/checkout@v4
with:
token: ${{ secrets.ACTION_TOKEN }}
submodules: true

- name: Set up JDK 17
uses:
actions/setup-java@v4
with:
java-version: '17'
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: Set up JDK 17
uses:
actions/setup-java@v4
with:
java-version: '17'
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: Setup Gradle
uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0
- name: Setup Gradle
uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0

- name: Build with Gradle
run:
./gradlew -version
./gradlew clean build
- name: Build with Gradle
run:
./gradlew -version
./gradlew clean build

- name: ls
run: ls

deplpoy:
needs: build
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.working-directory }}

steps:
- name: ls
run: ls

- name: AWS credential
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ${{ secrets.AWS_REGION }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: ls
run: ls

- name: AWS credential
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ${{ secrets.AWS_REGION }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

- name: Upload to AWS S3
run: aws s3 cp ./build/libs/chatserver-0.0.1-SNAPSHOT.jar s3://${{ secrets.S3_DEPLOY_BUCKET }}/chatserver-0.0.1-SNAPSHOT-`date +%Y%m%d`.jar
- name: Upload to AWS S3
run: aws s3 cp ./build/libs/chatserver-0.0.1-SNAPSHOT.jar s3://${{ secrets.S3_DEPLOY_BUCKET }}/chatserver-0.0.1-SNAPSHOT-`date +%Y%m%d`.jar

# - name: Deploy EC2
# run: aws deploy create-deployment --application-name ${{ env.AWS_CODE_DEPLOY_APPLICATION }} --deployment-config-name CodeDeployDefault.AllAtOnce --deployment-group-name ${{ env.AWS_CODE_DEPLOY_GROUP }} --s3-location bucket=$AWS_S3_BUCKET,key=cicdtest/$GITHUB_SHA.zip,bundleType=zip
Expand Down

0 comments on commit b18de94

Please sign in to comment.