diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a429a2a98..6dd8049f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,8 @@ on: jobs: build-java: - runs-on: ubuntu-latest + runs-on: aws-selfhosted + steps: - uses: actions/checkout@v2 @@ -29,10 +30,9 @@ jobs: run: ./gradlew build - name: Build and Push Docker Image - uses: mr-smithers-excellent/docker-build-push@v4 + uses: khalids226/docker-build-push@v4 with: - image: nanajanashia/demo-app + image: khalids226/demojavaapp registry: docker.io username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml new file mode 100644 index 000000000..19946e13d --- /dev/null +++ b/.github/workflows/github-actions-demo.yml @@ -0,0 +1,18 @@ +name: GitHub Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +on: [push] +jobs: + Explore-GitHub-Actions: + runs-on: self-hosted + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v3 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..4aa8bf635 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,27 @@ +name: Animal Farm NodeJS CI + +on: + push: + branches: + - khalids226-patch-1 + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: '16.x' + + - name: Install dependencies + run: yarn + + - name: Run tests + run: yarn test diff --git a/Dockerfile b/Dockerfile index d2b1dc574..28e522611 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM openjdk:8-jre-alpine EXPOSE 8080 -COPY ./build/libs/my-app-1.0-SNAPSHOT.jar /usr/app/ +COPY /build/libs/java-app-1.0-SNAPSHOT.jar /usr/app/ WORKDIR /usr/app -ENTRYPOINT ["java", "-jar", "my-app-1.0-SNAPSHOT.jar"] +ENTRYPOINT ["java", "-jar", "java-app-1.0-SNAPSHOT.jar"]