diff --git a/.github/workflows/build-tomcat.yml b/.github/workflows/build-tomcat.yml new file mode 100755 index 0000000..d7a9996 --- /dev/null +++ b/.github/workflows/build-tomcat.yml @@ -0,0 +1,44 @@ +name: Build Tomcat + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Check out tomcat-users.xml + uses: actions/checkout@v2 + + - name: List project files and java version + run: | + ls -ltr + java -version + + - name: Check out Apache Tomcat + uses: actions/checkout@v2 + with: + repository: apache/tomcat # Repository name with owner + ref: master # The branch, tag or SHA to checkout + path: ./tomcat # Relative path under $GITHUB_WORKSPACE + + - name: Setup Java 9 + uses: actions/setup-java@v1 + with: + java-version: '9.0.4' # The JDK version to make available on the path + java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk + architecture: x64 # (x64 or x86) - defaults to x64 + + - name: List project files and java version + run: | + ls -ltr + java -version + + - name: Copy tomcat-users.xml into Tomcat configuration directory + run: cp -v tomcat-users.xml ./tomcat/conf/tomcat-users.xml + + - name: Compile Tomcat + run: | + cd ./tomcat + ant diff --git a/.github/workflows/first.yml b/.github/workflows/first.yml deleted file mode 100755 index 27569f5..0000000 --- a/.github/workflows/first.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: first - -on: push - -jobs: - job1: - name: First job - runs-on: ubuntu-latest - steps: - - name: Step one - uses: actions/checkout@v2 - - name: Step two - run: env | sort - job2: - name: Second job - runs-on: windows-latest - steps: - - name: Step one - uses: actions/checkout@v2 - - name: Step two - run: "Get-ChildItem Env: | Sort-Object Name" \ No newline at end of file diff --git a/README.md b/README.md index 238fed3..baab793 100755 --- a/README.md +++ b/README.md @@ -1,22 +1,53 @@ -# Chapter 01_01 +# Passing arguments to an action -- Create a repository on GitHub using the [New Repository](https://github.com/new) page. Name it something that relates to the lesson like `exercise-files`. +In this lesson, arguments are passed to the following actions: -- In a terminal, run the following commands to initialize the directory as a git repository. +- [actions/checkout](https://github.com/actions/checkout) +- [actions/setup-java](https://github.com/actions/setup-java) - git init - git add . - git commit -m 'first check in' +``` +name: Build Tomcat -- Now add the new repository you created as a remote for the local repo. +on: [push] - git remote add origin git@github.com:YOUR_GITHUB_USER_NAME_HERE/exercise-files.git +jobs: + build: -- After the remote is added, push the files to the remote. + runs-on: ubuntu-latest - git push -u origin master + steps: + - name: Check out tomcat-users.xml + uses: actions/checkout@v2 - - Browse to the repository on GitHub.com and reload the page to confirm the files have been properly pushed. + - name: List project files and java version + run: | + ls -ltr + java -version -Once the files are hosted on GitHub.com, you're ready to start making changes locally and pushing them to the remote repo. -# GA-lesson-01-01 + - name: Check out Apache Tomcat + uses: actions/checkout@v2 + with: + repository: apache/tomcat # Repository name with owner + ref: master # The branch, tag or SHA to checkout + path: ./tomcat # Relative path under $GITHUB_WORKSPACE + + - name: Setup Java 9 + uses: actions/setup-java@v1 + with: + java-version: '9.0.4' # The JDK version to make available on the path + java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk + architecture: x64 # (x64 or x86) - defaults to x64 + + - name: List project files and java version + run: | + ls -ltr + java -version + + - name: Copy tomcat-users.xml into Tomcat configuration directory + run: cp -v tomcat-users.xml ./tomcat/conf/tomcat-users.xml + + - name: Compile Tomcat + run: | + cd ./tomcat + ant +``` diff --git a/tomcat-users.xml b/tomcat-users.xml new file mode 100755 index 0000000..3373ab4 --- /dev/null +++ b/tomcat-users.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + +