task: Test first GHA workflow [DHIS2-18615] #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Hello World Pipeline | |
on: | |
pull_request: | |
# For this to work, this workflow needs to be on master https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#workflow_run | |
# workflow_run: | |
# workflows: ["Check formatting"] | |
# types: | |
# - completed | |
jobs: | |
say-hello: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: temurin | |
# Set up Maven | |
- name: Set up Maven | |
env: | |
GIT_COMMIT: ${{ github.sha }} | |
run: | | |
sudo apt-get install maven | |
echo "On branch: $GITHUB_HEAD_REF" | |
echo "Git commit: GIT_COMMIT" | |
# Run Maven build | |
- name: Build with Maven | |
run: mvn --threads 4 --batch-mode --no-transfer-progress clean install --update-snapshots --file ./dhis-2/pom.xml -DskipTests | |
- name: Sync war | |
run: | | |
echo "Syncing WAR ..." | |
curl "https://raw.githubusercontent.com/dhis2/dhis2-server-setup/master/ci/scripts/copy-war-s3.sh" -O | |
chmod +x copy-war-s3.sh | |
./copy-war-s3.sh dev $GITHUB_REF_NAME |