Created
July 15, 2020 21:07
-
-
Save jmerle/3187803778f7b6bd112b13ddb77441da to your computer and use it in GitHub Desktop.
The GitHub Actions workflow I use in the ICFP Programming Contest 2020
This file contains hidden or 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: Build | |
on: | |
push: | |
branches-ignore: | |
- submission | |
pull_request: | |
branches-ignore: | |
- submission | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Build | |
run: ./gradlew shadowJar | |
- name: Prepare submission | |
run: | | |
cp -r submission ../submission | |
cp build/libs/icfpc-2020.jar ../submission/icfpc-2020.jar | |
if: github.ref == 'refs/heads/master' && github.event_name == 'push' | |
- name: Push submission | |
run: | | |
git checkout submission -- | |
git rm -rf . | |
git clean -fxd | |
cp -r ../submission/. . | |
git add -A | |
git config --local user.name "GitHub Actions" | |
git config --local user.email "[email protected]" | |
git commit -m "Auto-submit from build #$GITHUB_RUN_NUMBER" | |
git push | |
if: github.ref == 'refs/heads/master' && github.event_name == 'push' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment