Skip to content

Commit

Permalink
check gradle-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
thalals authored Feb 15, 2024
1 parent 866cffc commit d2a7fa9
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,28 @@ jobs:
./gradlew -version
./gradlew clean build

- 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: ls
run: ls

- 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

# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
# the publishing section of your build.gradle
- name: Publish to GitHub Packages
run: ./gradlew publish
env:
USERNAME: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - 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: 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
#
# # The USERNAME and TOKEN need to correspond to the credentials environment variables used in
# # the publishing section of your build.gradle
# - name: Publish to GitHub Packages
# run: ./gradlew publish
# env:
# USERNAME: ${{ github.actor }}
# TOKEN: ${{ secrets.GITHUB_TOKEN }}


0 comments on commit d2a7fa9

Please sign in to comment.